just make sre we really ret registers (some constants were flying about)
This commit is contained in:
parent
e1b29d799a
commit
cae99f217c
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user