allow get_slot with two registers

before was register and number, but for runtime that doesn’t work
This commit is contained in:
Torsten Ruger 2015-11-07 17:34:41 +02:00
parent c9c0f66d79
commit 35afe88ede
2 changed files with 9 additions and 4 deletions

View File

@ -120,7 +120,12 @@ module Interpreter
def execute_GetSlot def execute_GetSlot
object = object_for( @instruction.array ) 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 #value = value.object_id unless value.is_a? Fixnum
set_register( @instruction.register , value ) set_register( @instruction.register , value )
true true

View File

@ -24,7 +24,7 @@ module Register
@index = index @index = index
@register = register @register = register
raise "index 0 " if index == 0 raise "index 0 " if index == 0
raise "not integer #{index}" unless index.is_a? Numeric 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 #{register}" unless RegisterValue.look_like_reg(register)
raise "Not register #{array}" unless RegisterValue.look_like_reg(array) raise "Not register #{array}" unless RegisterValue.look_like_reg(array)
end end