mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Change to debugAssert and make debugAssert run in ASan
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user