Explorar el Código

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.
Andreas Kling hace 1 año
padre
commit
e67f6343f7
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp

+ 4 - 0
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;
+            }
         }
     }