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:
parent
70e2f51674
commit
e67f6343f7
Notes:
sideshowbarker
2024-07-17 06:33:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e67f6343f7 Pull-request: https://github.com/SerenityOS/serenity/pull/23873 Reviewed-by: https://github.com/shannonbooth
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue