parent
a039ae6cdb
commit
0b58ed4a22
2 changed files with 7 additions and 2 deletions
|
@ -315,6 +315,9 @@ func (v *VM) execute(ctx *Context, op Instruction) {
|
|||
case LEFT:
|
||||
l := int(v.estack.Pop().BigInt().Int64())
|
||||
s := v.estack.Pop().Bytes()
|
||||
if t := len(s); l > t {
|
||||
l = t
|
||||
}
|
||||
v.estack.PushVal(s[:l])
|
||||
case RIGHT:
|
||||
l := int(v.estack.Pop().BigInt().Int64())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue