nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f326aa
)
compile: Superstring compilation bug
author
Jean Privat
<jean@pryen.org>
Tue, 9 Jun 2009 19:23:17 +0000
(15:23 -0400)
committer
Jean Privat
<jean@pryen.org>
Wed, 10 Jun 2009 14:04:55 +0000
(10:04 -0400)
Before:
var a = 5
var b = "{a}"
print(a == b) # => true, a was overwrite
Signed-off-by: Jean Privat <jean@pryen.org>
src/compiling/compiling_methods.nit
patch
|
blob
|
history
diff --git
a/src/compiling/compiling_methods.nit
b/src/compiling/compiling_methods.nit
index
c823b83
..
3e20f95
100644
(file)
--- a/
src/compiling/compiling_methods.nit
+++ b/
src/compiling/compiling_methods.nit
@@
-1323,8
+1323,10
@@
redef class ASuperstringExpr
for ne in n_exprs do
var e = v.ensure_var(v.compile_expr(ne), "super-string element")
if ne.stype != stype then
- v.add_assignment(e, meth_to_s.compile_call(v, [e]))
+ v.cfc.free_var(e)
+ e = meth_to_s.compile_call(v, [e])
end
+ v.cfc.free_var(e)
meth_add.compile_call(v, [array, e])
end