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

Side by Side Diff: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp

Issue 840623002: Do not iterate past the end on processing leaf class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/left_most_gc_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This clang plugin checks various invariants of the Blink garbage 5 // This clang plugin checks various invariants of the Blink garbage
6 // collection infrastructure. 6 // collection infrastructure.
7 // 7 //
8 // Errors are described at: 8 // Errors are described at:
9 // http://www.chromium.org/developers/blink-gc-plugin-errors 9 // http://www.chromium.org/developers/blink-gc-plugin-errors
10 10
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 return; 1093 return;
1094 } 1094 }
1095 ReportBaseClassMustDeclareVirtualTrace(info, left_most); 1095 ReportBaseClassMustDeclareVirtualTrace(info, left_most);
1096 return; 1096 return;
1097 } 1097 }
1098 1098
1099 // Check condition (2): 1099 // Check condition (2):
1100 if (DeclaresVirtualMethods(left_most)) 1100 if (DeclaresVirtualMethods(left_most))
1101 return; 1101 return;
1102 if (left_most_base) { 1102 if (left_most_base) {
1103 ++it; // Get the base next to the "safe polymorphic base" 1103 // Get the base next to the "safe polymorphic base"
1104 if (it != left_most->bases_end())
1105 ++it;
1104 if (it != left_most->bases_end()) { 1106 if (it != left_most->bases_end()) {
1105 if (CXXRecordDecl* next_base = it->getType()->getAsCXXRecordDecl()) { 1107 if (CXXRecordDecl* next_base = it->getType()->getAsCXXRecordDecl()) {
1106 if (CXXRecordDecl* next_left_most = GetLeftMostBase(next_base)) { 1108 if (CXXRecordDecl* next_left_most = GetLeftMostBase(next_base)) {
1107 if (DeclaresVirtualMethods(next_left_most)) 1109 if (DeclaresVirtualMethods(next_left_most))
1108 return; 1110 return;
1109 ReportLeftMostBaseMustBePolymorphic(info, next_left_most); 1111 ReportLeftMostBaseMustBePolymorphic(info, next_left_most);
1110 return; 1112 return;
1111 } 1113 }
1112 } 1114 }
1113 } 1115 }
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 1908
1907 private: 1909 private:
1908 BlinkGCPluginOptions options_; 1910 BlinkGCPluginOptions options_;
1909 }; 1911 };
1910 1912
1911 } // namespace 1913 } // namespace
1912 1914
1913 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( 1915 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X(
1914 "blink-gc-plugin", 1916 "blink-gc-plugin",
1915 "Check Blink GC invariants"); 1917 "Check Blink GC invariants");
OLDNEW
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/left_most_gc_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698