diff options
author | Juan M Gómez <info@jmgomez.me> | 2024-03-21 07:48:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-21 08:48:14 +0100 |
commit | 33902d9dbb65fbfdfbd6e3b2a34c6e19eccb762f (patch) | |
tree | 933b843969ccaa492030f16e0b3389dd0ac3e303 /compiler/ccgstmts.nim | |
parent | 50c1e93a7481a79634b5d444806c94c1ea12b8ff (diff) | |
download | Nim-33902d9dbb65fbfdfbd6e3b2a34c6e19eccb762f.tar.gz |
[Cpp] Fixes an issue when mixing hooks and calls (#23428)
Diffstat (limited to 'compiler/ccgstmts.nim')
-rw-r--r-- | compiler/ccgstmts.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index fb8c89650..345639d94 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -369,7 +369,10 @@ proc genSingleVar(p: BProc, v: PSym; vn, value: PNode) = line(p, cpsStmts, decl) else: tmp = initLocExprSingleUse(p, value) - lineF(p, cpsStmts, "$# = $#;\n", [decl, tmp.rdLoc]) + if value.kind == nkEmpty: + lineF(p, cpsStmts, "$#;\n", [decl]) + else: + lineF(p, cpsStmts, "$# = $#;\n", [decl, tmp.rdLoc]) return assignLocalVar(p, vn) initLocalVar(p, v, imm) |