Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 8a407c7c705257db424d9309e6eab066f0c04417..49f99fc8624d1acca4ede11ff8c87bf825bcc0b0 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -5386,10 +5386,11 @@ void Function::SetInstructions(const Code& value) const { |
} |
void Function::AttachCode(const Code& value) const { |
+ // Finish setting up code before activating it. |
+ value.set_owner(*this); |
SetInstructions(value); |
ASSERT(Function::Handle(value.function()).IsNull() || |
- (value.function() == this->raw())); |
- value.set_owner(*this); |
+ (value.function() == this->raw())); |
} |