Index: runtime/vm/flow_graph_builder.cc |
=================================================================== |
--- runtime/vm/flow_graph_builder.cc (revision 40777) |
+++ runtime/vm/flow_graph_builder.cc (working copy) |
@@ -1093,8 +1093,17 @@ |
UnchainContexts(current_context_level); |
} |
- |
- AddReturnExit(node->token_pos(), return_value); |
+ if (function.is_async_closure() && |
+ (node->return_type() == ReturnNode::kContinuation)) { |
+ // This return instruction may be followed by instructions |
+ // that get called when the async closure is resumed, so |
+ // do not add an exit and close the fragment. |
+ ReturnInstr* return_instr = |
+ new(I) ReturnInstr(node->token_pos(), return_value); |
+ AddInstruction(return_instr); |
+ } else { |
+ AddReturnExit(node->token_pos(), return_value); |
+ } |
Florian Schneider
2014/10/06 17:32:54
I'd imagine this looking like this:
AddReturnExit
|
} |