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 558637c9c190b5489e0ddccf37b0c62f921568af..b4eb04b5d0d88aecd8d7ed8bdb8ac233b30d0108 100644 |
--- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp |
+++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp |
@@ -85,38 +85,22 @@ void CheckFieldsVisitor::AtValue(Value* edge) { |
if (!Parent() || !edge->value()->IsGCAllocated()) |
return; |
- // In transition mode, disallow OwnPtr<T>, RawPtr<T> to GC allocated T's, |
- // also disallow T* in stack-allocated types. |
- if (options_.enable_oilpan) { |
- if (Parent()->IsOwnPtr() || |
- Parent()->IsRawPtrClass() || |
- (stack_allocated_host_ && Parent()->IsRawPtr())) { |
- invalid_fields_.push_back(std::make_pair( |
- current_, InvalidSmartPtr(Parent()))); |
- return; |
- } |
- if (options_.warn_raw_ptr && Parent()->IsRawPtr()) { |
- if (static_cast<RawPtr*>(Parent())->HasReferenceType()) { |
- invalid_fields_.push_back(std::make_pair( |
- current_, kReferencePtrToGCManagedWarning)); |
- } else { |
- invalid_fields_.push_back(std::make_pair( |
- current_, kRawPtrToGCManagedWarning)); |
- } |
- } |
- return; |
- } |
- |
- if (Parent()->IsRawPtr() || Parent()->IsOwnPtr()) { |
+ // Disallow OwnPtr<T>, RefPtr<T> and T* to stack-allocated types. |
+ if (Parent()->IsOwnPtr() || |
+ (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) || |
sof
2016/04/18 21:23:15
Note: this RefPtr<T> check wasn't previously done
|
+ (stack_allocated_host_ && Parent()->IsRawPtr())) { |
invalid_fields_.push_back(std::make_pair( |
current_, InvalidSmartPtr(Parent()))); |
return; |
} |
- |
- if (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) { |
- invalid_fields_.push_back(std::make_pair( |
- current_, InvalidSmartPtr(Parent()))); |
- return; |
+ if (options_.warn_raw_ptr && Parent()->IsRawPtr()) { |
+ if (static_cast<RawPtr*>(Parent())->HasReferenceType()) { |
+ invalid_fields_.push_back(std::make_pair( |
+ current_, kReferencePtrToGCManagedWarning)); |
+ } else { |
+ invalid_fields_.push_back(std::make_pair( |
+ current_, kRawPtrToGCManagedWarning)); |
+ } |
} |
} |