diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-28 11:04:11 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-28 11:04:11 -0800 |
commit | 00b643e31badf20d270501e5ae15a17baa864c6f (patch) | |
tree | b9715b1753f035ef6b176978295b99d6f55f7ee0 /lib | |
parent | 285911f5875b18c12ebc1e82621a7b7ac0f164d2 (diff) |
fix check on whether a global is external; fixes issue #24
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/JSBackend/JSBackend.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index 8a82bbdb94..c698f96eb6 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -322,8 +322,8 @@ namespace { } else if (const BlockAddress *BA = dyn_cast<const BlockAddress>(V)) { return getBlockAddress(BA); } else { - if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) { - if (GV->hasExternalLinkage()) { + if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) { + if (!GV->hasInitializer()) { // We don't have a constant to emit here, so we must emit a postSet // All postsets are of external values, so they are pointers, hence 32-bit std::string Name = getOpName(V); |