Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp

Issue 1158623002: Extend destructor checks to account for eagerly finalized class types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated to look for IsEagerlyFinalizedMarker instead Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp
diff --git a/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp b/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..07409cc3ab36b48cbc905e5a78a7c7013608e38f
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "destructor_eagerly_finalized.h"
+
+namespace blink {
+
+HeapObjectEagerFinalized::~HeapObjectEagerFinalized()
+{
+ // Valid access to a non-eagerly finalized field
+ m_obj->foo();
+}
+
+void HeapObjectEagerFinalized::trace(Visitor* visitor)
+{
+ visitor->trace(m_obj);
+}
+
+HeapObjectEagerFinalizedAlso::~HeapObjectEagerFinalizedAlso()
+{
+ // Valid access to a non-eagerly finalized field
+ m_heapObject->foo();
+
+ // Non-valid accesses to eagerly finalized fields.
+ m_heapObjectFinalized->foo();
+ m_heapVector[0]->foo();
+}
+
+void HeapObjectEagerFinalizedAlso::trace(Visitor* visitor)
+{
+ visitor->trace(m_heapObject);
+ visitor->trace(m_heapObjectFinalized);
+ visitor->trace(m_heapVector);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698