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

Unified Diff: runtime/vm/longjump.cc

Issue 9169102: Add Dart_PropagateError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Removed some unneeded includes Created 8 years, 11 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
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();

Powered by Google App Engine
This is Rietveld 408576698