You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/preamble.js
+2-2
Original file line number
Diff line number
Diff line change
@@ -41,13 +41,13 @@ var ACCEPTABLE_SAFE_HEAP_ERRORS = 0;
41
41
function SAFE_HEAP_ACCESS(dest, type, store, ignore, storeValue) {
42
42
//if (dest === A_NUMBER) Module.print ([dest, type, store, ignore, storeValue] + ' ' + stackTrace()); // Something like this may be useful, in debugging
43
43
44
-
assert(dest > 0, 'segmentation fault');
44
+
if (dest <= 0) abort('segmentation fault ' + (store ? ('storing value ' + storeValue) : 'loading') + ' type ' + type + ' at address ' + dest);
45
45
46
46
#if USE_TYPED_ARRAYS
47
47
// When using typed arrays, reads over the top of TOTAL_MEMORY will fail silently, so we must
48
48
// correct that by growing TOTAL_MEMORY as needed. Without typed arrays, memory is a normal
49
49
// JS array so it will work (potentially slowly, depending on the engine).
50
-
assert(ignore || dest < Math.max(DYNAMICTOP, STATICTOP));
50
+
if (!ignore && dest >= Math.max(DYNAMICTOP, STATICTOP)) abort('segmentation fault ' + (store ? ('storing value ' + storeValue) : 'loading') + ' type ' + type + ' at address ' + dest + '. Heap ends at address ' + Math.max(DYNAMICTOP, STATICTOP));
0 commit comments