summaryrefslogtreecommitdiffstats
path: root/src/sat/bsat2/Alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sat/bsat2/Alloc.h')
-rw-r--r--src/sat/bsat2/Alloc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sat/bsat2/Alloc.h b/src/sat/bsat2/Alloc.h
index 7f506cb5..9a65cf0c 100644
--- a/src/sat/bsat2/Alloc.h
+++ b/src/sat/bsat2/Alloc.h
@@ -97,7 +97,11 @@ void RegionAllocator<T>::capacity(uint32_t min_cap)
cap += delta;
if (cap <= prev_cap)
+#ifdef __wasm
+ abort();
+#else
throw OutOfMemoryException();
+#endif
}
// printf(" .. (%p) cap = %u\n", this, cap);
@@ -119,7 +123,11 @@ RegionAllocator<T>::alloc(int size)
// Handle overflow:
if (sz < prev_sz)
+#ifdef __wasm
+ abort();
+#else
throw OutOfMemoryException();
+#endif
return prev_sz;
}