diff options
author | 2022-03-14 23:37:08 -0700 | |
---|---|---|
committer | 2022-03-14 23:37:08 -0700 | |
commit | e3b363163422132d650430f32d2efcd1f2af9155 (patch) | |
tree | 7da9f1e5412b897c677fcead5db5ff9782425fd9 /src | |
parent | 7b8113c7c70bb3bf6916404123e1c30c233a2d6c (diff) | |
download | bun-e3b363163422132d650430f32d2efcd1f2af9155.tar.gz bun-e3b363163422132d650430f32d2efcd1f2af9155.tar.zst bun-e3b363163422132d650430f32d2efcd1f2af9155.zip |
Handle segfault when console.log'ing stuff that should never make it to console.log in the first place
Diffstat (limited to 'src')
-rw-r--r-- | src/javascript/jsc/bindings/exports.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/javascript/jsc/bindings/exports.zig b/src/javascript/jsc/bindings/exports.zig index eefc45022..85ae5ac9e 100644 --- a/src/javascript/jsc/bindings/exports.zig +++ b/src/javascript/jsc/bindings/exports.zig @@ -1231,6 +1231,15 @@ pub const ZigConsoleClient = struct { .cell = js_type, }; + // Cell is the "unknown" type + // if we call JSObjectGetPrivate, it can segfault + if (js_type == .Cell) { + return .{ + .tag = .NativeCode, + .cell = js_type, + }; + } + if (CAPI.JSObjectGetPrivate(value.asObjectRef()) != null) return .{ .tag = .Private, |