Merge pull request #1404 from filecoin-project/asr/segfault
Bugfix: Check if vmctx is nil before dereferencing in ApplyMessage
This commit is contained in:
commit
954085d33e
@ -532,15 +532,21 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
|
|||||||
return nil, xerrors.Errorf("gas handling math is wrong")
|
return nil, xerrors.Errorf("gas handling math is wrong")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ApplyRet{
|
r := ApplyRet{
|
||||||
MessageReceipt: types.MessageReceipt{
|
MessageReceipt: types.MessageReceipt{
|
||||||
ExitCode: errcode,
|
ExitCode: errcode,
|
||||||
Return: ret,
|
Return: ret,
|
||||||
GasUsed: gasUsed,
|
GasUsed: gasUsed,
|
||||||
},
|
},
|
||||||
ActorErr: actorErr,
|
ActorErr: actorErr,
|
||||||
InternalExecutions: vmctx.internalExecutions,
|
InternalExecutions: nil,
|
||||||
}, nil
|
}
|
||||||
|
|
||||||
|
if vmctx != nil {
|
||||||
|
r.InternalExecutions = vmctx.internalExecutions
|
||||||
|
}
|
||||||
|
|
||||||
|
return &r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vm *VM) SetBlockMiner(m address.Address) {
|
func (vm *VM) SetBlockMiner(m address.Address) {
|
||||||
|
Loading…
Reference in New Issue
Block a user