rewritten goto based exception handling; much cleaner implementation;… (#13677)

* rewritten goto based exception handling; much cleaner implementation; fixes #13668
This commit is contained in:
Andreas Rumpf 2020-03-17 23:18:43 +01:00 • committed by GitHub
commit fe7b1dfb2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 26 deletions

View file

@ -975,7 +975,7 @@ proc genProcBody(p: BProc; procBody: PNode) =
genStmts(p, procBody) # modifies p.locals, p.init, etc.
if {nimErrorFlagAccessed, nimErrorFlagDeclared} * p.flags == {nimErrorFlagAccessed}:
p.flags.incl nimErrorFlagDeclared
p.blocks[0].sections[cpsLocals].add(ropecg(p.module, "NI* nimErr_;$n", []))
p.blocks[0].sections[cpsLocals].add(ropecg(p.module, "NIM_BOOL* nimErr_;$n", []))
p.blocks[0].sections[cpsInit].add(ropecg(p.module, "nimErr_ = #nimErrorFlag();$n", []))
proc genProcAux(m: BModule, prc: PSym) =