aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-11 03:08:54 +0800
committerobscuren <geffobscura@gmail.com>2015-06-11 03:08:54 +0800
commite7627623b96d06f4963ae424d2cb41cf9ba86e72 (patch)
tree84e25b023308b6905262ab86b48c857a5edc3971 /core/vm
parentf94c5473ad7139e42e22db8e099792638b73de77 (diff)
downloadgo-tangerine-e7627623b96d06f4963ae424d2cb41cf9ba86e72.tar.gz
go-tangerine-e7627623b96d06f4963ae424d2cb41cf9ba86e72.tar.zst
go-tangerine-e7627623b96d06f4963ae424d2cb41cf9ba86e72.zip
core/vm: reverse loop stack
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/logger.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/vm/logger.go b/core/vm/logger.go
index 6d08cbebe..96d07dab5 100644
--- a/core/vm/logger.go
+++ b/core/vm/logger.go
@@ -13,8 +13,9 @@ func StdErrFormat(logs []StructLog) {
for _, log := range logs {
fmt.Fprintf(os.Stderr, "PC %08d: %s GAS: %v COST: %v\n", log.Pc, log.Op, log.Gas, log.GasCost)
fmt.Fprintln(os.Stderr, "STACK =", len(log.Stack))
- for i, item := range log.Stack {
- fmt.Fprintf(os.Stderr, "%04d: %x\n", i, common.LeftPadBytes(item.Bytes(), 32))
+
+ for i := len(log.Stack) - 1; i >= 0; i-- {
+ fmt.Fprintf(os.Stderr, "%04d: %x\n", len(log.Stack)-i-1, common.LeftPadBytes(log.Stack[i].Bytes(), 32))
}
const maxMem = 10