mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
Return gas left
This commit is contained in:
parent
e18d24c74e
commit
b5b2ca72a2
1 changed files with 3 additions and 0 deletions
|
|
@ -126,6 +126,9 @@ func (self *JitVm) Run(me, caller ContextRef, code []byte, value, gas, price *bi
|
||||||
r := C.evmjit_run(unsafe.Pointer(&data), unsafe.Pointer(self))
|
r := C.evmjit_run(unsafe.Pointer(&data), unsafe.Pointer(self))
|
||||||
fmt.Printf("JIT result: %d\n", r)
|
fmt.Printf("JIT result: %d\n", r)
|
||||||
|
|
||||||
|
gasLeft := llvm2big(&data.elems[Gas]) // TODO: Set value directly to gas instance
|
||||||
|
gas.Set(gasLeft)
|
||||||
|
|
||||||
if r >= 100 {
|
if r >= 100 {
|
||||||
err = errors.New("OOG from JIT")
|
err = errors.New("OOG from JIT")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue