test and fix arg passing offset too
This commit is contained in:
parent
13b8d0645f
commit
4ca15449be
@ -28,8 +28,9 @@ module Phisol
|
|||||||
# processing should return the register with the value
|
# processing should return the register with the value
|
||||||
val = process( arg)
|
val = process( arg)
|
||||||
raise "Not register #{val}" unless val.is_a?(Register::RegisterValue)
|
raise "Not register #{val}" unless val.is_a?(Register::RegisterValue)
|
||||||
# which we load int the new_message at the argument's index
|
# which we load int the new_message at the argument's index (the one comes from c index)
|
||||||
@method.source.add_code Register.set_slot( statement , val , :new_message , i + 1)
|
set = Register.set_slot( statement , val , :new_message , i + 1 + Parfait::Message.offset)
|
||||||
|
@method.source.add_code set
|
||||||
end
|
end
|
||||||
|
|
||||||
# now we have to resolve the method name (+ receiver) into a callable method
|
# now we have to resolve the method name (+ receiver) into a callable method
|
||||||
|
@ -97,8 +97,10 @@ HERE
|
|||||||
@expect = [ [SaveReturn , GetSlot,GetSlot,SetSlot,LoadConstant,SetSlot,LoadConstant,
|
@expect = [ [SaveReturn , GetSlot,GetSlot,SetSlot,LoadConstant,SetSlot,LoadConstant,
|
||||||
SetSlot,RegisterTransfer,FunctionCall,GetSlot],
|
SetSlot,RegisterTransfer,FunctionCall,GetSlot],
|
||||||
[RegisterTransfer,GetSlot,FunctionReturn]]
|
[RegisterTransfer,GetSlot,FunctionReturn]]
|
||||||
check
|
was = check
|
||||||
end
|
set = was[0].codes[7]
|
||||||
|
assert_equal SetSlot , set.class
|
||||||
|
assert_equal 8, set.index , "Set to message must be offset, not #{set.index}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user