aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-08-25 13:26:21 +0300
committermax99x <max99x@gmail.com>2011-08-25 13:26:21 +0300
commit7977da083080c6535545360ba00890030dab4c74 (patch)
treeb14fd45b4205e1a24bdaeade546b8ae6544c8a51
parent5d737c3b7012f9936b3293b2211e59a5e22f4c78 (diff)
Made sure SAFE_HEAP allows storing of NaNs (e.g. from math functions).
-rw-r--r--src/preamble.js2
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);