fix tisop

Adding nil checks on the exit paths for semCompiles errors.
This was probably not needed before, because semIndirectOp
had a special detection for semCompiles contexts. We could
try to restore these, but wouldn't this just postpone the crashes
until someone tries the same expressions in nimrod check?

One of the previous commits also used errorNode to avoid
returning nil. This may be an alaternative approach.
This commit is contained in:
Zahary Karadjov
2013-08-27 01:49:21 +03:00
parent 9cc23118be
commit 52b00630c8

View File

@@ -766,7 +766,7 @@ proc semDirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode =
let nOrig = n.copyTree
#semLazyOpAux(c, n)
result = semOverloadedCallAnalyseEffects(c, n, nOrig, flags)
result = afterCallActions(c, result, nOrig, flags)
if result != nil: result = afterCallActions(c, result, nOrig, flags)
proc buildStringify(c: PContext, arg: PNode): PNode =
if arg.typ != nil and
@@ -1994,4 +1994,4 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
else:
LocalError(n.info, errInvalidExpressionX,
renderTree(n, {renderNoComments}))
incl(result.flags, nfSem)
if result != nil: incl(result.flags, nfSem)