From e67f6343f7f21d8eb1537bf8ee76c40e527c84b0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 Apr 2024 08:51:46 +0200 Subject: [PATCH] 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. --- Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp b/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp index bffdefe90ea..5344d99b449 100644 --- a/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp +++ b/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp @@ -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; + } } }