diff options
-rw-r--r-- | src/preamble.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index 64b3e222..59389e58 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -71,7 +71,7 @@ function SAFE_HEAP_STORE(dest, value, type, ignore) { print('SAFE_HEAP store: ' + [dest, type, value, ignore]); #endif - if (!ignore && !value && value !== 0 && value !== false) { // false can be the result of a mathop comparator + if (!ignore && !value && value !== 0 && value !== false && !isNaN(value)) { // false can be the result of a mathop comparator; NaN can be the result of a math function throw('Warning: Writing an invalid value of ' + JSON.stringify(value) + ' at ' + dest + ' :: ' + new Error().stack + '\n'); } SAFE_HEAP_ACCESS(dest, type, true, ignore); |