mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-05 04:27:44 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user