From 4d3f9333c6694d7987faa00b7221ee705db1b06b Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 7 Jun 2013 19:27:52 +0200 Subject: [PATCH] Never make functions without body available_externally. --- gen/llvmhelpers.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index c0e3a45f..3b150ac0 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1502,6 +1502,11 @@ bool mustDefineSymbol(Dsymbol* s) if (fd->semanticRun < PASSsemantic3) return false; + // If a function has no body, we cannot possibly emit it (and so it + // cannot be available_externally either). + if (!fd->fbody) + return false; + if (fd->isArrayOp == 1) return true;