Port https://github.com/neo-project/neo-vm/pull/514 or its analogue after the merge.
Port neo-project/neo-vm#514 or its analogue after the merge.