Skip to content

Commit

Permalink
Merge 3fd7638 into 6c90b10
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDenver007 committed May 8, 2019
2 parents 6c90b10 + 3fd7638 commit 7aa384b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions processor/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ func opGetAssetAmount(pc *uint64, evm *EVM, contract *Contract, memory *Memory,

ast, err := evm.AccountDB.GetAssetInfoByID(astID)
if err != nil || ast == nil {
stack.push(evm.interpreter.intPool.getZero())
stack.push(evm.interpreter.intPool.getZero())
return nil, nil
}
Expand All @@ -457,6 +458,7 @@ func opGetAssetAmount(pc *uint64, evm *EVM, contract *Contract, memory *Memory,
if uint64(datalen) > retSize.Uint64()*32 {
err = errors.New("out of space")
stack.push(evm.interpreter.intPool.getZero())
stack.push(evm.interpreter.intPool.getZero())
return nil, nil
}

Expand All @@ -465,8 +467,10 @@ func opGetAssetAmount(pc *uint64, evm *EVM, contract *Contract, memory *Memory,
amount, err := evm.AccountDB.GetAssetAmountByTime(astID, t)
if err != nil {
stack.push(evm.interpreter.intPool.getZero())
stack.push(evm.interpreter.intPool.getZero())
} else {
stack.push(amount)
stack.push(evm.interpreter.intPool.getZero())
}
evm.interpreter.intPool.put(time, assetID)
return nil, nil
Expand Down
2 changes: 1 addition & 1 deletion processor/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func NewByzantiumInstructionSet() [256]operation {
instructionSet[ASSETAMOUNT] = operation{
execute: opGetAssetAmount,
gasCost: gasGetAssetAmount,
validateStack: makeStackFunc(2, 1),
validateStack: makeStackFunc(2, 2),
valid: true,
returns: true,
}
Expand Down

0 comments on commit 7aa384b

Please sign in to comment.