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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10032009: Fix a crash in graoh builder where a throw node is added in an expression tree by the parser: allow… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 6338)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -1186,7 +1186,10 @@
class ThrowInstr : public Instruction {
public:
ThrowInstr(intptr_t node_id, intptr_t token_index, Value* exception)
- : node_id_(node_id), token_index_(token_index), exception_(exception) {
+ : node_id_(node_id),
+ token_index_(token_index),
+ exception_(exception),
+ successor_(NULL) {
ASSERT(exception_ != NULL);
}
@@ -1196,13 +1199,20 @@
intptr_t token_index() const { return token_index_; }
Value* exception() const { return exception_; }
- virtual Instruction* StraightLineSuccessor() const { return NULL; }
- virtual void SetSuccessor(Instruction* instr) { UNREACHABLE(); }
+ // Parser can generate a throw within an expression tree.
+ virtual Instruction* StraightLineSuccessor() const {
+ return successor_;
+ }
+ virtual void SetSuccessor(Instruction* instr) {
+ ASSERT(successor_ == NULL);
+ successor_ = instr;
+ }
private:
intptr_t node_id_;
intptr_t token_index_;
Value* exception_;
+ Instruction* successor_;
DISALLOW_COPY_AND_ASSIGN(ThrowInstr);
};
@@ -1217,7 +1227,8 @@
: node_id_(node_id),
token_index_(token_index),
exception_(exception),
- stack_trace_(stack_trace) {
+ stack_trace_(stack_trace),
+ successor_(NULL) {
ASSERT(exception_ != NULL);
ASSERT(stack_trace_ != NULL);
}
@@ -1229,14 +1240,21 @@
Value* exception() const { return exception_; }
Value* stack_trace() const { return stack_trace_; }
- virtual Instruction* StraightLineSuccessor() const { return NULL; }
- virtual void SetSuccessor(Instruction* instr) { UNREACHABLE(); }
+ // Parser can generate a rethrow within an expression tree.
+ virtual Instruction* StraightLineSuccessor() const {
+ return successor_;
+ }
+ virtual void SetSuccessor(Instruction* instr) {
+ ASSERT(successor_ == NULL);
+ successor_ = instr;
+ }
private:
intptr_t node_id_;
intptr_t token_index_;
Value* exception_;
Value* stack_trace_;
+ Instruction* successor_;
DISALLOW_COPY_AND_ASSIGN(ReThrowInstr);
};
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698