summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/-ext-/debug/test_debug.rb49
-rw-r--r--yjit/src/codegen.rs10
2 files changed, 54 insertions, 5 deletions
@@ -75,19 +75,58 @@ class TestDebug < Test::Unit::TestCase
end
assert_equal true, x, '[Bug #15105]'
end
- # This is a YJIT test, but we can't test this without a C extension that calls
- # rb_debug_inspector_open(), so we're testing it using "-test-/debug" here.
- def test_yjit_invalidates_setlocal_after_inspector_call
val = setlocal_after_proc_call(proc { Bug::Debug.inspector; :ok })
assert_equal :ok, val
- end if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
private
def setlocal_after_proc_call(block)
local = block.call # setlocal followed by OPTIMIZED_METHOD_TYPE_CALL
itself # split a block using a C call
local # getlocal
end
-end
@@ -2445,6 +2445,11 @@ fn gen_getlocal_generic(
ep_offset: u32,
level: u32,
) -> Option<CodegenStatus> {
let local_opnd = if level == 0 && jit.assume_no_ep_escape(asm) {
// Load the local using SP register
asm.local_opnd(ep_offset)
@@ -2535,6 +2540,11 @@ fn gen_setlocal_generic(
return Some(KeepCompiling);
}
let (flags_opnd, local_opnd) = if level == 0 && jit.assume_no_ep_escape(asm) {
// Load flags and the local using SP register
let flags_opnd = asm.ctx.ep_opnd(VM_ENV_DATA_INDEX_FLAGS as i32);