From 4fbf538b6613bebc3205b065e95438cea0777033 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 6 Jun 2025 15:36:31 +0200 Subject: [PATCH] nifgen: bugfix (#24979) --- compiler/nifgen.nim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/nifgen.nim b/compiler/nifgen.nim index 63b993cddf..c834ee8b36 100644 --- a/compiler/nifgen.nim +++ b/compiler/nifgen.nim @@ -1526,7 +1526,16 @@ proc toNif(n, parent: PNode; c: var TranslationContext; allowEmpty = false) = toNif(n[i], n, c) c.b.endTree() c.depsEnabled = oldDepsEnabled - of nkDiscardStmt, nkBreakStmt, nkContinueStmt, nkReturnStmt, nkRaiseStmt, + of nkReturnStmt: + relLineInfo(n, parent, c) + c.b.addTree(nodeKindTranslation(n.kind)) + if n.len > 0 and n[0].kind in {nkAsgn, nkFastAsgn}: + toNif(n[0][1], n, c) + else: + for i in 0..