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

Unified Diff: runtime/vm/parser.cc

Issue 973843005: Fix VM bug with super-constructor invocation and mixins. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « runtime/vm/parser.h ('k') | tests/language/constructor_with_mixin_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 44224)
+++ runtime/vm/parser.cc (working copy)
@@ -2153,6 +2153,7 @@
void Parser::GenerateSuperConstructorCall(const Class& cls,
intptr_t supercall_pos,
LocalVariable* receiver,
+ AstNode* phase_parameter,
ArgumentListNode* forwarding_args) {
const Class& super_class = Class::Handle(Z, cls.SuperClass());
// Omit the implicit super() if there is no super class (i.e.
@@ -2171,9 +2172,6 @@
AstNode* implicit_argument = new LoadLocalNode(supercall_pos, receiver);
arguments->Add(implicit_argument);
// Implicit construction phase parameter is second argument.
- AstNode* phase_parameter =
- new LiteralNode(supercall_pos,
- Smi::ZoneHandle(Z, Smi::New(Function::kCtorPhaseAll)));
arguments->Add(phase_parameter);
// If this is a super call in a forwarding constructor, add the user-
@@ -2564,7 +2562,10 @@
if (!super_init_seen) {
// Generate implicit super() if we haven't seen an explicit super call
// or constructor redirection.
- GenerateSuperConstructorCall(cls, TokenPos(), receiver, NULL);
+ AstNode* phase_parameter = new LiteralNode(
+ TokenPos(), Smi::ZoneHandle(Z, Smi::New(Function::kCtorPhaseAll)));
+ GenerateSuperConstructorCall(
+ cls, TokenPos(), receiver, phase_parameter, NULL);
}
CheckFieldsInitialized(cls);
}
@@ -2686,10 +2687,12 @@
}
}
- GenerateSuperConstructorCall(current_class(),
- Scanner::kNoSourcePos,
- receiver,
- forwarding_args);
+ GenerateSuperConstructorCall(
+ current_class(),
+ Scanner::kNoSourcePos,
+ receiver,
+ new LoadLocalNode(Scanner::kNoSourcePos, phase_parameter),
+ forwarding_args);
CheckFieldsInitialized(current_class());
// Empty constructor body.
« no previous file with comments | « runtime/vm/parser.h ('k') | tests/language/constructor_with_mixin_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698