| 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);
|
| }
|
|
|