1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

_mjit_compile_insn_body: rollback pc correctly

for catch_except_p case

Partially solving Bug#14892

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-07-07 14:28:34 +00:00
parent 886cfe4962
commit c2df63d08a
2 changed files with 6 additions and 6 deletions

View file

@ -686,10 +686,12 @@ class TestJIT < Test::Unit::TestCase
end end
def test_stack_pointer_with_regexpmatch def test_stack_pointer_with_regexpmatch
skip assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "aa", success_count: 1)
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "nil\nnil\n", success_count: 1)
begin; begin;
1000.times { break if /a/ =~ "ab" && !$~[0] } 2.times do
break if /a/ =~ "ab" && !$~[0]
print $~[0]
end
end; end;
end end

View file

@ -69,9 +69,7 @@
% end % end
% when /\A\s+DISPATCH_ORIGINAL_INSN\([^)]+\);\s+\z/ % when /\A\s+DISPATCH_ORIGINAL_INSN\([^)]+\);\s+\z/
% # For `opt_xxx`'s fallbacks. % # For `opt_xxx`'s fallbacks.
if (!body->catch_except_p) { fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
}
fprintf(f, " goto cancel;\n"); fprintf(f, " goto cancel;\n");
% else % else
fprintf(f, <%= to_cstr.call(line) %>); fprintf(f, <%= to_cstr.call(line) %>);