RJIT: Fix unwanted shadowing in set_local_type
local_idx should not be overwritten.
This commit is contained in:
parent
ffa5f16273
commit
68bcca4c2b
@ -42,3 +42,17 @@ assert_equal '1', %q{
|
||||
|
||||
entry
|
||||
}
|
||||
|
||||
# Updating local type in Context
|
||||
assert_normal_exit %q{
|
||||
def foo(flag, object)
|
||||
klass = if flag
|
||||
object
|
||||
end
|
||||
klass ||= object
|
||||
return klass.new
|
||||
end
|
||||
|
||||
foo(false, Object)
|
||||
foo(true, Object)
|
||||
}
|
||||
|
@ -264,9 +264,9 @@ module RubyVM::RJIT
|
||||
# noop
|
||||
in MapToSelf
|
||||
# noop
|
||||
in MapToLocal[local_idx]
|
||||
if stack_idx == local_idx
|
||||
self.temp_types[stack_idx] = self.local_types[local_idx];
|
||||
in MapToLocal[temp_local_idx]
|
||||
if stack_idx == temp_local_idx
|
||||
self.temp_types[stack_idx] = self.local_types[temp_local_idx]
|
||||
self.temp_mapping[stack_idx] = MapToStack
|
||||
else
|
||||
# noop
|
||||
|
Loading…
x
Reference in New Issue
Block a user