From 33902d9dbb65fbfdfbd6e3b2a34c6e19eccb762f Mon Sep 17 00:00:00 2001 From: Juan M Gómez Date: Thu, 21 Mar 2024 07:48:14 +0000 Subject: [Cpp] Fixes an issue when mixing hooks and calls (#23428) --- compiler/ccgstmts.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/ccgstmts.nim') 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) -- cgit 1.4.1-2-gfad0