fix code init bug
where initial pos wasnt propagated
This commit is contained in:
@ -18,6 +18,13 @@ module Risc
|
||||
end
|
||||
|
||||
def position_changed(position)
|
||||
nekst = position.object.next
|
||||
if( nekst )
|
||||
nekst_pos = Position.get(nekst)
|
||||
unless(nekst_pos.valid?)
|
||||
nekst_pos.set(position + position.object.padded_length)
|
||||
end
|
||||
end
|
||||
set_jump_for(position)
|
||||
end
|
||||
|
||||
|
@ -178,7 +178,11 @@ module Risc
|
||||
end
|
||||
self.positions[position.object] = position
|
||||
@reverse_cache[to] = position unless position.object.is_a?(Label)
|
||||
log.debug "Set #{position} to 0x#{to.to_s(16)} for #{position.object.class} #{position.object.object_id.to_s(16)}"
|
||||
if to == -1
|
||||
log.debug "Initialize for #{position.object.class} #{position.object.object_id.to_s(16)}"
|
||||
else
|
||||
log.debug "Set #{position} to 0x#{to.to_s(16)} for #{position.object.class} #{position.object.object_id.to_s(16)}"
|
||||
end
|
||||
position
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user