Commit fdd27d0d authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[ext-code-space] Fix UnreachableObjectsFilter

The CodeObjectSlot might contain Smi zero during CodeDataContainer/Code
initialization.

Bug: v8:11880, v8:12962
Change-Id: I5fba135dfa1786716f30d7c8cdad3052a967d894
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3707100
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81182}
parent dc597278
......@@ -6566,8 +6566,11 @@ class UnreachableObjectsFilter : public HeapObjectsFilter {
void VisitCodePointer(HeapObject host, CodeObjectSlot slot) override {
CHECK(V8_EXTERNAL_CODE_SPACE_BOOL);
HeapObject code = HeapObject::unchecked_cast(slot.load(code_cage_base()));
MarkHeapObject(code);
Object maybe_code = slot.load(code_cage_base());
HeapObject heap_object;
if (maybe_code.GetHeapObject(&heap_object)) {
MarkHeapObject(heap_object);
}
}
void VisitCodeTarget(Code host, RelocInfo* rinfo) final {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment