allow get_slot with two registers
before was register and number, but for runtime that doesn’t work
This commit is contained in:
parent
c9c0f66d79
commit
35afe88ede
@ -120,7 +120,12 @@ module Interpreter
|
||||
|
||||
def execute_GetSlot
|
||||
object = object_for( @instruction.array )
|
||||
value = object.internal_object_get( @instruction.index )
|
||||
if( @instruction.index.is_a?(Numeric) )
|
||||
index = @instruction.index
|
||||
else
|
||||
index = get_register(@instruction.index)
|
||||
end
|
||||
value = object.internal_object_get( index )
|
||||
#value = value.object_id unless value.is_a? Fixnum
|
||||
set_register( @instruction.register , value )
|
||||
true
|
||||
@ -192,7 +197,7 @@ module Interpreter
|
||||
else
|
||||
raise "unimplemented '#{@instruction.operator}' #{@instruction}"
|
||||
end
|
||||
## result not over 2**62 => overflow
|
||||
## result not over 2**62 => overflow
|
||||
log.debug "#{@instruction} == #{result} (#{left}|#{right})"
|
||||
right = set_register(@instruction.left , result)
|
||||
true
|
||||
|
@ -23,8 +23,8 @@ module Register
|
||||
@array = array
|
||||
@index = index
|
||||
@register = register
|
||||
raise "index 0 " if index == 0
|
||||
raise "not integer #{index}" unless index.is_a? Numeric
|
||||
raise "index 0 " if index == 0
|
||||
raise "Not integer or reg #{index}" unless index.is_a?(Numeric) or RegisterValue.look_like_reg(index)
|
||||
raise "Not register #{register}" unless RegisterValue.look_like_reg(register)
|
||||
raise "Not register #{array}" unless RegisterValue.look_like_reg(array)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user