make C backend more robust against compiler bugs
This commit is contained in:
parent
e1600f209f
commit
2f692dcc3a
1 changed files with 2 additions and 0 deletions
|
|
@ -761,6 +761,8 @@ proc genProcAux(m: BModule, prc: PSym) =
|
|||
var returnStmt: PRope = nil
|
||||
assert(prc.ast != nil)
|
||||
if sfPure notin prc.flags and prc.typ.sons[0] != nil:
|
||||
if resultPos >= prc.ast.len:
|
||||
internalError(prc.info, "proc has no result symbol")
|
||||
var res = prc.ast.sons[resultPos].sym # get result symbol
|
||||
if not isInvalidReturnType(prc.typ.sons[0]):
|
||||
if sfNoInit in prc.flags: incl(res.flags, sfNoInit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue