Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Merge ca04c0b into 0ea2fc5
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Aug 19, 2019
2 parents 0ea2fc5 + ca04c0b commit 285490f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ All notable changes to this project are documented in this file.
- Fix ``Contract.Destroy`` not always deleting storage
- Fix ``Equals()`` of ``ByteArray``
- Fix max recursion depth exception when counting certain VM StackItems that point to themselves
- Fix ``RIGHT`` opcode for 0 count edge case


[0.8.4] 2019-02-14
Expand Down
11 changes: 9 additions & 2 deletions neo/VM/ExecutionEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@ def ExecuteInstruction(self):

x = estack.Pop().GetByteArray()

estack.PushT(x[:count])
if count >= len(x):
estack.PushT(x)
else:
estack.PushT(x[:count])
self.CheckStackSize(True, -1)

elif opcode == RIGHT:
Expand All @@ -469,7 +472,11 @@ def ExecuteInstruction(self):
if count > len(x):
return self.VM_FAULT_and_report(VMFault.RIGHT_UNKNOWN)

estack.PushT(x[-count:])
if count == len(x):
estack.PushT(x)
else:
offset = len(x) - count
estack.PushT(x[offset:offset + count])
self.CheckStackSize(True, -1)

elif opcode == SIZE:
Expand Down

0 comments on commit 285490f

Please sign in to comment.