OSDN Git Service
(root)
/
bytom
/
equity.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix the operation for binary operator with the same variable (#16)
[bytom/equity.git]
/
compiler
/
compile.go
diff --git
a/compiler/compile.go
b/compiler/compile.go
index
c3d277f
..
7145274
100644
(file)
--- a/
compiler/compile.go
+++ b/
compiler/compile.go
@@
-498,7
+498,9
@@
func compileStatement(b *builder, stk stack, contract *Contract, env *environ, c
}
// restore the defined variable counts
- counts[stmt.variable.Name] = varCount
+ if tmpCounts[stmt.variable.Name] > 0 {
+ counts[stmt.variable.Name] = varCount
+ }
// modify stack name
stk.str = stmt.variable.Name