aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/js_ast.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig
index fbeddcbb8..11ff6e82f 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -120,6 +120,11 @@ pub fn NewBaseStore(comptime Union: anytype, comptime count: usize) type {
pub fn reset() void {
const blocks = _self.overflow.slice();
for (blocks) |b| {
+ if (comptime Environment.isDebug) {
+ // ensure we crash if we use a freed value
+ var bytes = std.mem.asBytes(&b.items);
+ @memset(bytes, undefined, bytes.len);
+ }
b.used = 0;
}
_self.overflow.used = 0;