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

Unified Diff: runtime/vm/parser.cc

Issue 2354603003: Fix crashes due to attempts to create an identifier name containing the word <bottom>. Likely there… (Closed)
Patch Set: This flag is needed by Dartium for JS interop. Created 4 years, 2 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
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index cb9c620101ec318ff2baffb48bf4f5a698cea49e..970f75dbd9a2930b60f05ffe00f0d21f60a07395 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -61,6 +61,7 @@ DEFINE_FLAG(bool, assert_initializer, false,
DECLARE_FLAG(bool, profile_vm);
DECLARE_FLAG(bool, trace_service);
+DECLARE_FLAG(bool, ignore_patch_signature_mismatch);
// Quick access to the current thread, isolate and zone.
#define T (thread())
@@ -4731,35 +4732,37 @@ void Parser::ParseClassDeclaration(const GrowableObjectArray& pending_classes,
"class '%s' must be patched with identical type parameters",
class_name.ToCString());
}
- TypeParameter& new_type_param = TypeParameter::Handle(Z);
- TypeParameter& orig_type_param = TypeParameter::Handle(Z);
- String& new_name = String::Handle(Z);
- String& orig_name = String::Handle(Z);
- AbstractType& new_bound = AbstractType::Handle(Z);
- AbstractType& orig_bound = AbstractType::Handle(Z);
- for (int i = 0; i < new_type_params_count; i++) {
- new_type_param ^= new_type_parameters.TypeAt(i);
- orig_type_param ^= orig_type_parameters.TypeAt(i);
- new_name = new_type_param.name();
- orig_name = orig_type_param.name();
- if (!new_name.Equals(orig_name)) {
- ReportError(new_type_param.token_pos(),
- "type parameter '%s' of patch class '%s' does not match "
- "original type parameter '%s'",
- new_name.ToCString(),
- class_name.ToCString(),
- orig_name.ToCString());
- }
- new_bound = new_type_param.bound();
- orig_bound = orig_type_param.bound();
- if (!new_bound.Equals(orig_bound)) {
- ReportError(new_type_param.token_pos(),
- "bound '%s' of type parameter '%s' of patch class '%s' "
- "does not match original type parameter bound '%s'",
- String::Handle(new_bound.UserVisibleName()).ToCString(),
- new_name.ToCString(),
- class_name.ToCString(),
- String::Handle(orig_bound.UserVisibleName()).ToCString());
+ if (!FLAG_ignore_patch_signature_mismatch) {
+ TypeParameter& new_type_param = TypeParameter::Handle(Z);
+ TypeParameter& orig_type_param = TypeParameter::Handle(Z);
+ String& new_name = String::Handle(Z);
+ String& orig_name = String::Handle(Z);
+ AbstractType& new_bound = AbstractType::Handle(Z);
+ AbstractType& orig_bound = AbstractType::Handle(Z);
+ for (int i = 0; i < new_type_params_count; i++) {
+ new_type_param ^= new_type_parameters.TypeAt(i);
+ orig_type_param ^= orig_type_parameters.TypeAt(i);
+ new_name = new_type_param.name();
+ orig_name = orig_type_param.name();
+ if (!new_name.Equals(orig_name)) {
+ ReportError(new_type_param.token_pos(),
+ "type parameter '%s' of patch class '%s' does not match "
+ "original type parameter '%s'",
+ new_name.ToCString(),
+ class_name.ToCString(),
+ orig_name.ToCString());
+ }
+ new_bound = new_type_param.bound();
+ orig_bound = orig_type_param.bound();
+ if (!new_bound.Equals(orig_bound)) {
+ ReportError(new_type_param.token_pos(),
+ "bound '%s' of type parameter '%s' of patch class '%s' "
+ "does not match original type parameter bound '%s'",
+ String::Handle(new_bound.UserVisibleName()).ToCString(),
+ new_name.ToCString(),
+ class_name.ToCString(),
+ String::Handle(orig_bound.UserVisibleName()).ToCString());
+ }
}
}
cls.set_type_parameters(orig_type_parameters);
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698