Commit 9fc9344c authored by yann300's avatar yann300

use BN for storage decoding

parent 01acbda3
'use strict' 'use strict'
var util = require('./util')
class RefType { class RefType {
constructor (storageSlots, storageBytes, typeName, location) { constructor (storageSlots, storageBytes, typeName, location) {
...@@ -29,10 +30,11 @@ class RefType { ...@@ -29,10 +30,11 @@ class RefType {
storage = {} // TODO this is a fallback, should manage properly locals store in storage storage = {} // TODO this is a fallback, should manage properly locals store in storage
} }
var offset = stack[stack.length - 1 - stackDepth] var offset = stack[stack.length - 1 - stackDepth]
offset = parseInt(offset, 16)
if (this.isInStorage()) { if (this.isInStorage()) {
offset = util.toBN(offset)
return this.decodeFromStorage({ offset: 0, slot: offset }, storage) return this.decodeFromStorage({ offset: 0, slot: offset }, storage)
} else if (this.isInMemory()) { } else if (this.isInMemory()) {
offset = parseInt(offset, 16)
return this.decodeFromMemoryInternal(offset, memory) return this.decodeFromMemoryInternal(offset, memory)
} else { } else {
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment