mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Fallback to standard VM when running precompiled contracts
This commit is contained in:
parent
ce677ffd87
commit
0d08eb86b6
1 changed files with 8 additions and 0 deletions
|
|
@ -148,6 +148,14 @@ func NewJitVm(env Environment) *JitVm {
|
|||
|
||||
func (self *JitVm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) {
|
||||
self.env.SetDepth(self.env.Depth() + 1)
|
||||
|
||||
if Precompiled[string(me.Address())] != nil {
|
||||
// if it's address of precopiled contract
|
||||
// fallback to standard VM
|
||||
stdVm := New(self.env)
|
||||
return stdVm.Run(me, caller, code, value, gas, price, callData)
|
||||
}
|
||||
|
||||
self.me = me // FIXME: Make sure Run() is not used more than once
|
||||
self.callerAddr = caller.Address()
|
||||
self.price = price
|
||||
|
|
|
|||
Loading…
Reference in a new issue