[前][次][番号順一覧][スレッド一覧]

ruby-changes:31456

From: nobu <ko1@a...>
Date: Tue, 5 Nov 2013 16:56:56 +0900 (JST)
Subject: [ruby-changes:31456] nobu:r43535 (trunk): eval.c: suppress warning

nobu	2013-11-05 16:56:49 +0900 (Tue, 05 Nov 2013)

  New Revision: 43535

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43535

  Log:
    eval.c: suppress warning
    
    * eval.c (rb_protect): get rid of false clobbered warning.

  Modified files:
    trunk/eval.c
Index: eval.c
===================================================================
--- eval.c	(revision 43534)
+++ eval.c	(revision 43535)
@@ -778,7 +778,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/eval.c#L778
 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 https://github.com/ruby/ruby/blob/trunk/eval.c#L792
     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 https://github.com/ruby/ruby/blob/trunk/eval.c#L802
     if (state) {
 	*state = status;
     }
-    if (status != 0) {
-	th->cfp = cfp;
-	return Qnil;
-    }
 
     return result;
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]