Skip to content

Commit 8ff4406

Browse files
committed
Make sure the object we're looking at has an internalField before accessing it
1 parent 19031b2 commit 8ff4406

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/engines/v8/v8.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,10 @@ fn getExternalEntry(value: v8.Value) ?*ExternalEntry {
747747
return null;
748748
}
749749
const obj = value.castTo(Object);
750+
if (obj.internalFieldCount() == 0) {
751+
return null;
752+
}
753+
750754
const external_data = obj.getInternalField(0).castTo(v8.External).get().?;
751755
return @alignCast(@ptrCast(external_data));
752756
}

vendor/zig-v8

0 commit comments

Comments
 (0)