fix code init bug

where initial pos wasnt propagated
This commit is contained in:
Torsten Ruger
2018-06-09 09:16:23 +03:00
parent e4b4551acf
commit cf94227b2c
3 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -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