aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-20 22:03:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-20 22:05:54 +0900
commite81a3e6df54842b5a836dad7055a4295cf4155bc (patch)
tree4da7dc9f6a16085c5623c3a09e5cbf768d0963c7 /eval.c
parent9e171b1fa0b4e2e5b0bf82da11b4b511c602c336 (diff)
downloadruby-e81a3e6df54842b5a836dad7055a4295cf4155bc.tar.gz
Allows calling a private method only with bare `self`
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 5d402e5cb8..c548c34b68 100644
--- a/eval.c
+++ b/eval.c
@@ -189,13 +189,15 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex)
volatile VALUE errs[2] = { Qundef, Qundef };
int nerr;
rb_thread_t *th = rb_ec_thread_ptr(ec);
+ rb_thread_t *volatile const th0 = th;
volatile int sysex = EXIT_SUCCESS;
volatile int step = 0;
rb_threadptr_interrupt(th);
rb_threadptr_check_signal(th);
EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ th = th0;
+ if ((state = EC_EXEC_TAG(), th = th0, state) == TAG_NONE) {
SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(ec); });
step_0: step++;
@@ -548,10 +550,9 @@ static void
setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
{
VALUE e;
- const char *file = 0;
int line;
+ const char *const file = rb_source_location_cstr(&line);
- file = rb_source_location_cstr(&line);
if ((file && !NIL_P(mesg)) || (cause != Qundef)) {
volatile int state = 0;