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

Unified Diff: runtime/vm/kernel.cc

Issue 2866503003: Move a definition to fix a compiler error (Closed)
Patch Set: Created 3 years, 7 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/kernel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel.cc
diff --git a/runtime/vm/kernel.cc b/runtime/vm/kernel.cc
index afebbc180bdec0fbeae25a9e6bd72d060d31a8b4..726d0d867bffc9c5e6a7901264d79a1149122b6f 100644
--- a/runtime/vm/kernel.cc
+++ b/runtime/vm/kernel.cc
@@ -243,6 +243,14 @@ void LocalInitializer::VisitChildren(Visitor* visitor) {
FunctionNode::~FunctionNode() {}
+void FunctionNode::ReplaceBody(Statement* body) {
+ delete body_;
+ // Use static_cast to invoke the conversion function and so avoid triggering
+ // ASSERT(pointer_ == NULL) in operator= when overwriting a non-NULL body.
+ static_cast<Statement*&>(body_) = body;
+}
+
+
void FunctionNode::AcceptTreeVisitor(TreeVisitor* visitor) {
visitor->VisitFunctionNode(this);
}
« no previous file with comments | « runtime/vm/kernel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698