Index: tools/clang/blink_gc_plugin/RecordInfo.cpp |
diff --git a/tools/clang/blink_gc_plugin/RecordInfo.cpp b/tools/clang/blink_gc_plugin/RecordInfo.cpp |
index a7c9a756bfaa057da957be5e6193095121bca440..c766d28a54bfa67ee0fef72daba9f7e771ec8b73 100644 |
--- a/tools/clang/blink_gc_plugin/RecordInfo.cpp |
+++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp |
@@ -240,10 +240,18 @@ CXXMethodDecl* RecordInfo::DeclaresNewOperator() { |
return 0; |
} |
-// An object requires a tracing method if it has any fields that need tracing. |
+// An object requires a tracing method if it has any fields that need tracing |
+// or if it inherits from multiple bases that need tracing. |
bool RecordInfo::RequiresTraceMethod() { |
if (IsStackAllocated()) |
return false; |
+ unsigned bases_with_trace = 0; |
+ for (Bases::iterator it = GetBases().begin(); it != GetBases().end(); ++it) { |
+ if (it->second.NeedsTracing().IsNeeded()) |
+ ++bases_with_trace; |
+ } |
+ if (bases_with_trace > 1) |
+ return true; |
GetFields(); |
return fields_need_tracing_.IsNeeded(); |
} |