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

ruby-changes:48568

From: ko1 <ko1@a...>
Date: Tue, 7 Nov 2017 14:12:44 +0900 (JST)
Subject: [ruby-changes:48568] ko1:r60683 (trunk): rename to rb_ec_set_raised().

ko1	2017-11-07 14:12:39 +0900 (Tue, 07 Nov 2017)

  New Revision: 60683

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60683

  Log:
    rename to rb_ec_set_raised().
    
    * thread.c (rb_threadptr_set_raised): rename to rb_ec_set_raised
      and accepts `ec`

  Modified files:
    trunk/eval.c
    trunk/eval_error.c
    trunk/eval_intern.h
    trunk/thread.c
    trunk/vm_trace.c
Index: eval.c
===================================================================
--- eval.c	(revision 60682)
+++ eval.c	(revision 60683)
@@ -509,7 +509,7 @@ setup_exception(rb_execution_context_t * https://github.com/ruby/ruby/blob/trunk/eval.c#L509
 	volatile int state = 0;
 
 	EC_PUSH_TAG(ec);
-	if (EXEC_TAG() == TAG_NONE && !(state = rb_threadptr_set_raised(rb_ec_thread_ptr(ec)))) {
+	if (EXEC_TAG() == TAG_NONE && !(state = rb_ec_set_raised(ec))) {
 	    VALUE bt = rb_get_backtrace(mesg);
 	    if (!NIL_P(bt) || cause == Qundef) {
 		if (OBJ_FROZEN(mesg)) {
@@ -568,7 +568,7 @@ setup_exception(rb_execution_context_t * https://github.com/ruby/ruby/blob/trunk/eval.c#L568
 	}
     }
 
-    if (rb_threadptr_set_raised(rb_ec_thread_ptr(ec))) {
+    if (rb_ec_set_raised(ec)) {
       fatal:
 	ec->errinfo = exception_error;
 	rb_ec_reset_raised(ec);
Index: thread.c
===================================================================
--- thread.c	(revision 60682)
+++ thread.c	(revision 60683)
@@ -2167,12 +2167,12 @@ rb_threadptr_signal_exit(rb_thread_t *th https://github.com/ruby/ruby/blob/trunk/thread.c#L2167
 #endif
 
 int
-rb_threadptr_set_raised(rb_thread_t *th)
+rb_ec_set_raised(rb_execution_context_t *ec)
 {
-    if (th->ec->raised_flag & RAISED_EXCEPTION) {
+    if (ec->raised_flag & RAISED_EXCEPTION) {
 	return 1;
     }
-    th->ec->raised_flag |= RAISED_EXCEPTION;
+    ec->raised_flag |= RAISED_EXCEPTION;
     return 0;
 }
 
Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 60682)
+++ eval_intern.h	(revision 60683)
@@ -280,11 +280,11 @@ enum { https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L280
     RAISED_STACKOVERFLOW = 2,
     RAISED_NOMEMORY = 4
 };
-int rb_threadptr_set_raised(rb_thread_t *th);
 #define rb_thread_raised_set(th, f)   ((th)->ec->raised_flag |= (f))
 #define rb_thread_raised_reset(th, f) ((th)->ec->raised_flag &= ~(f))
 #define rb_thread_raised_p(th, f)     (((th)->ec->raised_flag & (f)) != 0)
 #define rb_thread_raised_clear(th)    ((th)->ec->raised_flag = 0)
+int rb_ec_set_raised(rb_execution_context_t *ec);
 int rb_ec_reset_raised(rb_execution_context_t *th);
 int rb_ec_stack_check(rb_execution_context_t *ec);
 
Index: eval_error.c
===================================================================
--- eval_error.c	(revision 60682)
+++ eval_error.c	(revision 60683)
@@ -271,7 +271,7 @@ error_handle(int ex) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L271
     int status = EXIT_FAILURE;
     rb_execution_context_t *ec = GET_EC();
 
-    if (rb_threadptr_set_raised(rb_ec_thread_ptr(ec)))
+    if (rb_ec_set_raised(ec))
 	return EXIT_FAILURE;
     switch (ex & TAG_MASK) {
       case 0:
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 60682)
+++ vm_trace.c	(revision 60683)
@@ -292,7 +292,7 @@ exec_hooks_protected(rb_execution_contex https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L292
     EC_POP_TAG();
 
     if (raised) {
-	rb_threadptr_set_raised(rb_ec_thread_ptr(ec));
+	rb_ec_set_raised(ec);
     }
 
     return state;

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

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