summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-05 07:56:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-05 07:56:49 +0000
commitf08c697cd4c86843c2bb14904ce245d7055d0843 (patch)
tree1096b2c202ce9b6fb9c664910c9d97f742e002b1 /eval.c
parent8a9dff36c3c9b14c676b9ef72e645ff403f8b20f (diff)
downloadruby-f08c697cd4c86843c2bb14904ce245d7055d0843.tar.gz
eval.c: suppress warning
* eval.c (rb_protect): get rid of false clobbered warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index b6916d16ba..cbe1206486 100644
--- a/eval.c
+++ b/eval.c
@@ -778,7 +778,7 @@ VALUE
rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
{
volatile VALUE result = Qnil;
- int status;
+ volatile int status;
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
struct rb_vm_protect_tag protect_tag;
@@ -792,6 +792,9 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
if ((status = TH_EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
}
+ else {
+ th->cfp = cfp;
+ }
MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
th->protect_tag = protect_tag.prev;
TH_POP_TAG();
@@ -799,10 +802,6 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
if (state) {
*state = status;
}
- if (status != 0) {
- th->cfp = cfp;
- return Qnil;
- }
return result;
}