Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 29 lines (23 sloc) 0.696 kB
6644819 @brixen Better handling of _set|_longjmp support and use of windows_compat.h.
brixen authored
1 #include <setjmp.h>
2
3 #include "config.h"
bd9b337 @brixen Fixed rb_raise.
brixen authored
4 #include "exception_point.hpp"
5 #include "builtin/nativemethod.hpp"
6644819 @brixen Better handling of _set|_longjmp support and use of windows_compat.h.
brixen authored
6 #include "windows_compat.h"
bd9b337 @brixen Fixed rb_raise.
brixen authored
7
8 namespace rubinius {
9 ExceptionPoint::ExceptionPoint(NativeMethodEnvironment* env)
10 : jumped_to_(false)
11 , previous_(env->current_ep())
12 {
13 env->set_current_ep(this);
14 }
15
16 void ExceptionPoint::return_to(NativeMethodEnvironment* env) {
17 jumped_to_ = true;
18 env->set_current_ep(this);
6644819 @brixen Better handling of _set|_longjmp support and use of windows_compat.h.
brixen authored
19 long_jump(__jump_buffer, 1);
bd9b337 @brixen Fixed rb_raise.
brixen authored
20
21 // If control reaches here, longjmp failed, i.e. disaster.
b3cf5f2 @evanphx Convert abort()s into bug()s
evanphx authored
22 rubinius::bug("ExceptionPoint return_to failed");
bd9b337 @brixen Fixed rb_raise.
brixen authored
23 }
24
25 void ExceptionPoint::pop(NativeMethodEnvironment* env) {
26 env->set_current_ep(previous_);
27 }
28 }
Something went wrong with that request. Please try again.