aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval_intern.h17
-rw-r--r--vm_eval.c2
2 files changed, 9 insertions, 10 deletions
diff --git a/eval_intern.h b/eval_intern.h
index 4d23d4e8a0..6b5ca7fe60 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -4,15 +4,14 @@
#include "ruby/ruby.h"
#include "vm_core.h"
-#define PASS_PASSED_BLOCK_TH(th) do { \
- (th)->passed_block = rb_vm_control_frame_block_ptr(th->cfp); \
- (th)->cfp->flag |= VM_FRAME_FLAG_PASSED; \
-} while (0)
-
-#define PASS_PASSED_BLOCK() do { \
- rb_thread_t * const __th__ = GET_THREAD(); \
- PASS_PASSED_BLOCK_TH(__th__); \
-} while (0)
+static inline void
+pass_passed_block(rb_thread_t *th)
+{
+ th->passed_block = rb_vm_control_frame_block_ptr(th->cfp);
+ th->cfp->flag |= VM_FRAME_FLAG_PASSED;
+}
+#define PASS_PASSED_BLOCK_TH(th) pass_passed_block(th)
+#define PASS_PASSED_BLOCK() pass_passed_block(GET_THREAD())
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
diff --git a/vm_eval.c b/vm_eval.c
index f550769799..3461966195 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -859,7 +859,7 @@ rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv)
VALUE
rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv)
{
- PASS_PASSED_BLOCK_TH(GET_THREAD());
+ PASS_PASSED_BLOCK();
return rb_call(recv, mid, argc, argv, CALL_PUBLIC);
}