cgen: fix gen_cross_tmp_variable, part 2

pull/5612/head
Alexander Medvednikov 2020-07-01 19:39:41 +02:00
parent 625ed030ef
commit 66f36f6dcc
1 changed files with 4 additions and 2 deletions

View File

@ -1301,7 +1301,8 @@ fn (mut g Gen) gen_cross_tmp_variable(left []ast.Expr, val ast.Expr) {
if lx is ast.Ident {
ident := lx as ast.Ident
if val.name == ident.name {
g.write('_var_$ident.pos.pos')
g.write('_var_')
g.write(ident.pos.pos.str())
has_var = true
break
}
@ -1342,7 +1343,8 @@ fn (mut g Gen) gen_cross_tmp_variable(left []ast.Expr, val ast.Expr) {
mut has_var := false
for lx in left {
if val_.str() == lx.str() {
g.write('_var_${lx.position()}.pos')
g.write('_var_')
g.write(lx.position().pos.str())
has_var = true
break
}