From 399d6815ef96a6940f366df507eb855ce6d3194e Mon Sep 17 00:00:00 2001 From: Ben Grant Date: Fri, 13 Jun 2025 11:31:34 -0700 Subject: [PATCH] Change to debugAssert and make debugAssert run in ASan --- src/bun.js/bindings/JSValue.zig | 2 +- src/bun.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bun.js/bindings/JSValue.zig b/src/bun.js/bindings/JSValue.zig index d87f4df7c2..bb15a0207a 100644 --- a/src/bun.js/bindings/JSValue.zig +++ b/src/bun.js/bindings/JSValue.zig @@ -2012,7 +2012,7 @@ pub const JSValue = enum(i64) { } pub fn asNumber(this: JSValue) f64 { - bun.assert(this.isNumber()); + bun.debugAssert(this.isNumber()); if (this.isInt32()) { return @floatFromInt(this.asInt32()); } else { diff --git a/src/bun.zig b/src/bun.zig index 0fb24bf626..31e88b9ac4 100644 --- a/src/bun.zig +++ b/src/bun.zig @@ -2998,7 +2998,7 @@ noinline fn assertionFailureWithMsg(comptime msg: []const u8, args: anytype) nor /// } /// ``` pub fn debugAssert(cheap_value_only_plz: bool) callconv(callconv_inline) void { - if (comptime !Environment.isDebug) { + if (comptime !(Environment.isDebug or Environment.enable_asan)) { return; }