diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-09 20:00:52 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-09 20:00:52 -0700 |
commit | 1896c00715d1cbfd47a295c9564691dcf88d6032 (patch) | |
tree | d2cc60a400f2b1878b63ae3773bd605701e36676 /src/preamble.js | |
parent | 953ebf768763fe93a0af76f5007d1f69f91d6440 (diff) |
check for segfaults in SAFE_HEAP
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index a8f19d64..bbb9d684 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -24,6 +24,8 @@ var ACCEPTABLE_SAFE_HEAP_ERRORS = 0; function SAFE_HEAP_ACCESS(dest, type, store, ignore) { //if (dest === A_NUMBER) Module.print ([dest, type, store] + ' ' + new Error().stack); // Something like this may be useful, in debugging + assert(dest >= STACK_ROOT, 'segmentation fault: null pointer, or below normal memory'); + #if USE_TYPED_ARRAYS // When using typed arrays, reads over the top of TOTAL_MEMORY will fail silently, so we must // correct that by growing TOTAL_MEMORY as needed. Without typed arrays, memory is a normal @@ -643,7 +645,7 @@ var base = intArrayFromString('(null)'); // So printing %s of NULL gives '(null) // Also this ensures we leave 0 as an invalid address, 'NULL' STATICTOP = base.length; for (var i = 0; i < base.length; i++) { - {{{ makeSetValue(0, 'i', 'base[i]', 'i8') }}} + {{{ makeSetValue(0, 'i', 'base[i]', 'i8', null, null, null, 1) }}} } Module['HEAP'] = HEAP; |