summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index d0f85ccad2..571b84a57d 100644
--- a/eval.c
+++ b/eval.c
@@ -1162,11 +1162,16 @@ rb_protect(VALUE (*proc) (VALUE), VALUE data, int *state)
int status;
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
+ struct rb_vm_trap_tag trap_tag = {
+ th->trap_tag,
+ };
PUSH_TAG();
+ th->trap_tag = &trap_tag;
if ((status = EXEC_TAG()) == 0) {
result = (*proc) (data);
}
+ th->trap_tag = trap_tag.prev;
POP_TAG();
if (state) {