LibJSGCVerifier: Warn on missing visit of JS::Value members

A JS::Value can refer to a GC-allocated object, so let's ensure they
are visited when necessary.
This commit is contained in:
Andreas Kling 2024-04-07 08:51:46 +02:00
parent 70e2f51674
commit e67f6343f7
Notes: sideshowbarker 2024-07-17 06:33:00 +09:00

View file

@ -160,6 +160,10 @@ FieldValidationResult validate_field(clang::FieldDecl const* field_decl)
result.is_wrapped_in_gcptr = true;
result.is_valid = record_inherits_from_cell(*record_decl);
result.needs_visiting = template_type_name != "RawGCPtr";
} else if (auto const* record = qualified_type->getAsCXXRecordDecl()) {
if (record->getQualifiedNameAsString() == "JS::Value") {
result.needs_visiting = true;
}
}
}