Chromium Code Reviews| Index: runtime/vm/longjump.cc |
| =================================================================== |
| --- runtime/vm/longjump.cc (revision 3415) |
| +++ runtime/vm/longjump.cc (working copy) |
| @@ -20,9 +20,19 @@ |
| } |
| +bool LongJump::IsSafeToJump() { |
| + // We do not want to jump past Dart frames. |
| + Isolate* isolate = Isolate::Current(); |
| + uword jumpbuf_addr = reinterpret_cast<uword>(this); |
| + return (isolate->top_exit_frame_info() == NULL || |
| + jumpbuf_addr < isolate->top_exit_frame_info()); |
|
siva
2012/01/31 00:52:34
This code seems to assume that the stack always gr
turnidge
2012/01/31 21:56:31
I also make this assumption in the stack overflow
siva
2012/02/01 19:09:38
Maybe a comment stating that this code assumes the
|
| +} |
| + |
| + |
| void LongJump::Jump(int value, const Error& error) { |
| // A zero is the default return value from setting up a LongJump using Set. |
| ASSERT(value != 0); |
| + ASSERT(IsSafeToJump()); |
| Isolate* isolate = Isolate::Current(); |