just make sre we really ret registers (some constants were flying about)

This commit is contained in:
Torsten Ruger 2014-10-07 12:23:08 +03:00
parent e1b29d799a
commit cae99f217c
2 changed files with 7 additions and 2 deletions

View File

@ -26,6 +26,11 @@ module Register
raise "abstract called for #{self.class}" raise "abstract called for #{self.class}"
end end
# wrap symbols into regsiter reference if needed
def wrap_register reg
return reg if reg.is_a? RegisterReference
RegisterReference.new(reg)
end
end end
end end

View File

@ -4,8 +4,8 @@ module Register
class RegisterTransfer < Instruction class RegisterTransfer < Instruction
def initialize from , to def initialize from , to
@from = from @from = wrap_register(from)
@to = to @to = wrap_register(to)
end end
attr_reader :from, :to attr_reader :from, :to
end end