diff --git a/lib/arm/instructions/call_instruction.rb b/lib/arm/instructions/call_instruction.rb index 1db1449c..4b956028 100644 --- a/lib/arm/instructions/call_instruction.rb +++ b/lib/arm/instructions/call_instruction.rb @@ -52,7 +52,7 @@ module Arm # But, for methods, this happens to be the size of the object header, # so there it balances out, but not blocks # have to use the code, not the method object for methods - arg = Risc::Position.get(@first) - Risc::Position.get(self) + 4 + arg = Risc::Position.get(@first) - Risc::Position.get(self) else arg = @first end diff --git a/test/arm/test_call.rb b/test/arm/test_call.rb index 20b463d2..6ae676c3 100644 --- a/test/arm/test_call.rb +++ b/test/arm/test_call.rb @@ -22,7 +22,7 @@ module Arm Risc::Position.set(@binary , 0) code = @machine.call( bin ,{} )#this jumps to the next instruction Risc::Position.set(code , 0, @binary) - assert_code code , :call, [0x09,0x0,0x0,0xeb] + assert_code code , :call, [0x08,0x0,0x0,0xeb] end def test_swi code = @machine.swi( 0x05 ) diff --git a/test/elf/test_hello.rb b/test/elf/test_hello.rb index 39376147..c0b4791f 100644 --- a/test/elf/test_hello.rb +++ b/test/elf/test_hello.rb @@ -12,7 +12,7 @@ class HelloTest < MiniTest::Test end def test_string_put - @input = "'Hello'.putstring" + @input = "return 'Hello'.putstring" check end end