fix bad scoping bug
This commit is contained in:
parent
d38097aea4
commit
486580aeb2
@ -15,8 +15,17 @@ module Arm
|
|||||||
def opcode
|
def opcode
|
||||||
@attributes[:opcode]
|
@attributes[:opcode]
|
||||||
end
|
end
|
||||||
|
def position
|
||||||
|
raise "position accessed but not set at #{length} for #{self.inspect}" if @position == nil
|
||||||
|
@position
|
||||||
|
end
|
||||||
|
def set_position pos
|
||||||
|
# resetting of position used to be error, but since relink and dynamic instruction size it is ok. in measures
|
||||||
|
if @position != nil and ((@position - pos).abs > 32)
|
||||||
|
raise "position set again #{pos}!=#{@position} for #{self}"
|
||||||
|
end
|
||||||
|
@position = pos
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# this is giving read access to the attributes hash via .attibute syntax
|
# this is giving read access to the attributes hash via .attibute syntax
|
||||||
# so for an instruction pop you can write pop.opcode to get the :opcode attribute
|
# so for an instruction pop you can write pop.opcode to get the :opcode attribute
|
||||||
@ -33,7 +42,7 @@ module Arm
|
|||||||
end
|
end
|
||||||
return @attributes[name.to_sym]
|
return @attributes[name.to_sym]
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require_relative "constants"
|
require_relative "constants"
|
||||||
|
Loading…
Reference in New Issue
Block a user