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

Unified Diff: runtime/vm/parser.cc

Issue 2710363002: Fix VM crash when parsing a non-existing redirecting constructor (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | tests/language/regress_28217_test.dart » ('j') | 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 bc6740cd67e8c6f34b7b1142f08060463ce24a6e..112a37c6e2cf5b3a45383c46d570f5c1b69cc05f 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -3121,12 +3121,11 @@ void Parser::ParseConstructorRedirection(const Class& cls,
Function::ZoneHandle(Z, cls.LookupConstructor(ctor_name));
if (redirect_ctor.IsNull()) {
if (cls.LookupFactory(ctor_name) != Function::null()) {
- ReportError(
- call_pos, "redirection constructor '%s' must not be a factory",
- String::Handle(Z, redirect_ctor.UserVisibleName()).ToCString());
+ ReportError(call_pos,
+ "redirection constructor '%s' must not be a factory",
+ ctor_name.ToCString());
hausner 2017/02/26 18:30:27 I think you want to use a user-visible name here,
Florian Schneider 2017/02/27 18:14:50 Good point. I'll change it to use ScrubName instea
}
- ReportError(call_pos, "constructor '%s' not found",
- String::Handle(Z, redirect_ctor.UserVisibleName()).ToCString());
+ ReportError(call_pos, "constructor '%s' not found", ctor_name.ToCString());
}
if (current_function().is_const() && !redirect_ctor.is_const()) {
ReportError(call_pos, "redirection constructor '%s' must be const",
« no previous file with comments | « no previous file | tests/language/regress_28217_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698