vm: support Map in ARRAYSIZE
Also make logic the same as in reference implementation and add tests.
This commit is contained in:
parent
c66f493017
commit
13d7770c68
2 changed files with 30 additions and 2 deletions
|
@ -807,10 +807,10 @@ func (v *VM) execute(ctx *Context, op Instruction) {
|
|||
switch t := elem.value.Value().(type) {
|
||||
case []StackItem:
|
||||
v.estack.PushVal(len(t))
|
||||
case []uint8:
|
||||
case map[interface{}]StackItem:
|
||||
v.estack.PushVal(len(t))
|
||||
default:
|
||||
panic("ARRAYSIZE: item not of type []StackItem")
|
||||
v.estack.PushVal(len(elem.Bytes()))
|
||||
}
|
||||
|
||||
case SIZE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue