From b5b2ca72a2ebbf3c89dde36b7e1aad2e6430c833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 15 Jan 2015 14:14:00 +0100 Subject: [PATCH] Return gas left --- vm/vm_jit.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vm/vm_jit.go b/vm/vm_jit.go index 1caf3d05ff..d84d3fb3cb 100644 --- a/vm/vm_jit.go +++ b/vm/vm_jit.go @@ -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)) 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 { err = errors.New("OOG from JIT") }