aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js
index f02ada7a..16b55d53 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -27,8 +27,8 @@ function SAFE_HEAP_ACCESS(dest, type, store) {
if (store) {
HEAP_HISTORY[dest] = [{ type: type, /*stack: new Error().stack */ }]; // |stack| is useful for debugging
} else {
- if (!HEAP[dest] && HEAP[dest] !== 0) {
- print('Warning: Reading an invalid value at ' + dest + ' :: ' + new Error().stack + '\n');
+ if (!HEAP[dest] && HEAP[dest] !== 0 && HEAP[dest] !== false) { // false can be the result of a mathop comparator
+ throw('Warning: Reading an invalid value at ' + dest + ' :: ' + new Error().stack + '\n');
}
var history = HEAP_HISTORY[dest];
assert((history && history[0]) /* || HEAP[dest] === 0 */, "Loading from where there was no store! " + dest + ',' + HEAP[dest] + ',' + type + ', \n\n' + new Error().stack + '\n');