diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-05-04 07:43:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 07:43:22 +0200 |
commit | b6fb609e0d263a209c6db48dd367f13eb7f4ff87 (patch) | |
tree | f2f177bb2c63bd28f8927501f6be6f48cca27dd4 /compiler/dfa.nim | |
parent | 3e060cfb0ab6b1affe26a7b09e6b4192e0d68a7f (diff) | |
download | Nim-b6fb609e0d263a209c6db48dd367f13eb7f4ff87.tar.gz |
destructors: don't produce stupid code for 'cast' (#14208) [backport:1.2]
* destructors: don't produce stupid code for 'cast' * fixes #14207
Diffstat (limited to 'compiler/dfa.nim')
-rw-r--r-- | compiler/dfa.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/dfa.nim b/compiler/dfa.nim index 0cefec285..7db5f5f65 100644 --- a/compiler/dfa.nim +++ b/compiler/dfa.nim @@ -541,8 +541,8 @@ template genNoReturn(c: var Con; n: PNode) = c.code.add Instr(n: n, kind: goto, dest: high(int) - c.code.len) proc genRaise(c: var Con; n: PNode) = - genJoins(c, n) gen(c, n[0]) + genJoins(c, n) if c.inTryStmt > 0: c.tryStmtFixups.add c.gotoI(n) else: @@ -553,11 +553,11 @@ proc genImplicitReturn(c: var Con) = gen(c, c.owner.ast[resultPos]) proc genReturn(c: var Con; n: PNode) = - genJoins(c, n) if n[0].kind != nkEmpty: gen(c, n[0]) else: genImplicitReturn(c) + genJoins(c, n) genNoReturn(c, n) const |