Index: runtime/vm/kernel.h |
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h |
index a6aae20ab6bcee7f1ee26b821c1be80174242be3..be32218552529f33896c792b4a3ba29b4665234d 100644 |
--- a/runtime/vm/kernel.h |
+++ b/runtime/vm/kernel.h |
@@ -935,7 +935,11 @@ class FunctionNode : public TreeNode { |
DartType* return_type() { return return_type_; } |
Statement* body() { return body_; } |
- void set_body(Statement* body) { body_ = body; } |
+ void set_body(Statement* 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; |
+ } |
TokenPosition position() { return position_; } |
TokenPosition end_position() { return end_position_; } |