fixed while instruciton linking after change in method add

This commit is contained in:
Torsten Ruger
2014-07-22 23:27:13 +03:00
parent 25e26f613d
commit e408b0e4b9
3 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,8 @@ module Ast
raise part.inspect if last.nil?
end
# unconditionally brnach to the start
method.add start
merge.next = method.current.next
method.current.next = start
# here we add the end of while that the branch jumps to
#but don't link it in (not using add)
method.current = merge

View File

@ -52,7 +52,7 @@ module Virtual
def set_var name , var
v = has_var name
if( v )
puts "resetting local #{v}"
puts "resetting local #{v.inspect}"
else
v = Local.new(name , var)
@locals << v