From 789c8e00650a31fce2a20c33e1f3043d0d0617c2 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 4 Jul 2019 22:53:21 -0700 Subject: [PATCH] fix #11651 exportc symbol not exported, leading to link error (#11658) (cherry picked from commit 95f2f2396f868b418996358d6328368395a1f5c6) --- compiler/ccgexprs.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 3d3ad4a532..ef32dc93a6 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2669,9 +2669,8 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = if ({sfExportc, sfCompilerProc} * prc.flags == {sfExportc}) or (sfExportc in prc.flags and lfExportLib in prc.loc.flags) or (prc.kind == skMethod): - # we have not only the header: - if prc.getBody.kind != nkEmpty or lfDynamicLib in prc.loc.flags: - genProc(p.module, prc) + # Generate proc even if empty body, bugfix #11651. + genProc(p.module, prc) of nkParForStmt: genParForStmt(p, n) of nkState: genState(p, n) of nkGotoState: