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

Unified Diff: tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp

Issue 2588943002: Disallow heap objects containing unsafe on-heap iterators. (Closed)
Patch Set: formatting Created 4 years 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/CheckFieldsVisitor.cpp
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
index 396ed95bf1cfea3de07cc57799a899c8e2678101..05419da6d67eb71958ecd944bf247bfe3803fee9 100644
--- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
+++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
@@ -47,6 +47,14 @@ void CheckFieldsVisitor::AtMember(Member* edge) {
invalid_fields_.push_back(std::make_pair(current_, kMemberInUnmanaged));
}
+void CheckFieldsVisitor::AtIterator(Iterator* edge) {
+ if (!managed_host_)
+ return;
+
+ if (edge->IsUnsafe())
+ invalid_fields_.push_back(std::make_pair(current_, kIteratorToGCManaged));
+}
+
void CheckFieldsVisitor::AtValue(Value* edge) {
// TODO: what should we do to check unions?
if (edge->value()->record()->isUnion())

Powered by Google App Engine
This is Rietveld 408576698