Fixed backtrace message for top-level blocks; fix #4936

In top-level, `mid` is `NULL`. We used to ignore 'mid` update for `NULL`.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-01-27 14:34:54 +09:00
parent 59464f3528
commit 364c47610f
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -1500,8 +1500,7 @@ RETRY_TRY_BLOCK:
mrb_sym mid;
struct REnv *e = MRB_PROC_ENV(m);
mid = e->mid;
if (mid) ci->mid = mid;
ci->mid = mid = e->mid;
if (!e->stack) {
e->stack = mrb->c->stack;
}
+2 -2
View File
@@ -400,7 +400,7 @@ assert('GC in rescue') do
end
rescue => exception
GC.start
assert_equal("#{__FILE__}:#{line}:in call",
assert_equal("#{__FILE__}:#{line}",
exception.backtrace.first)
end
end
@@ -418,7 +418,7 @@ assert('Method call in rescue') do
rescue => exception
[3].each do
end
assert_equal("#{__FILE__}:#{line}:in call",
assert_equal("#{__FILE__}:#{line}",
exception.backtrace.first)
end
end