aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler.js2
-rw-r--r--src/parseTools.js7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler.js b/src/compiler.js
index 94e77e26..365ff32f 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -176,6 +176,8 @@ DEAD_FUNCTIONS = numberedSet(DEAD_FUNCTIONS);
RUNTIME_DEBUG = LIBRARY_DEBUG || GL_DEBUG;
+if (SAFE_HEAP) USE_BSS = 0; // must initialize heap for safe heap
+
// Settings sanity checks
assert(!(USE_TYPED_ARRAYS === 2 && QUANTUM_SIZE !== 4), 'For USE_TYPED_ARRAYS == 2, must have normal QUANTUM_SIZE of 4');
diff --git a/src/parseTools.js b/src/parseTools.js
index babb2692..6bc0b7ea 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -472,10 +472,11 @@ function isBSS(item) {
return false;
}
+ if (item.external) return false; // externals are typically implemented in a JS library, and must be accessed by name, explicitly
+
// return true if a global is uninitialized or initialized to 0
- return item.external ||
- (item.value && item.value.intertype === 'emptystruct') ||
- (item.value && item.value.value !== undefined && item.value.value === '0');
+ return (item.value && item.value.intertype === 'emptystruct') ||
+ (item.value && item.value.value !== undefined && item.value.value === '0');
}
function makeGlobalDef(ident) {