aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/preamble.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 3b5eac3e..0232ff20 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -194,11 +194,13 @@ function Pointer_make(slab, pos, allocator) {
var size = slab.length;
var i;
+#if ASSERTIONS
for (i = 0; i < size; i++) {
if (slab[i] === undefined) {
throw 'Invalid element in slab at ' + new Error().stack; // This can be caught, and you can try again to allocate later, see globalFuncs in run()
}
}
+#endif
// Finalize
var ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc][allocator ? allocator : ALLOC_STATIC](Math.max(size, 1));