fix double label names

This commit is contained in:
Torsten Ruger
2015-11-14 22:53:01 +02:00
parent 278eccbed5
commit cc9b515752
4 changed files with 11 additions and 2 deletions

View File

@ -83,9 +83,10 @@ module Soml
# return self for chaining
def init_method
source = "_init_method"
@method.instructions = Register::Label.new(source, "#{method.for_class.name}.#{method.name}")
name = "#{method.for_class.name}.#{method.name}"
@method.instructions = Register::Label.new(source, name)
@current = enter = method.instructions
add_code Register::Label.new( source, "return")
add_code Register::Label.new( source, "return #{name}")
#load the return address into pc, affecting return. (other cpus have commands for this, but not arm)
add_code Register::FunctionReturn.new( source , Register.message_reg , Register.resolve_index(:message , :return_address) )
@current = enter