From 43e08ea32d9aa965315cdf9b507c9c844b28614c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 22 Dec 2014 22:54:51 +0100 Subject: [PATCH] Handle create/call depth limit in CREATE instruction --- libevmjit-cpp/Env.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libevmjit-cpp/Env.cpp b/libevmjit-cpp/Env.cpp index ca3ed2b92d..50945583b7 100644 --- a/libevmjit-cpp/Env.cpp +++ b/libevmjit-cpp/Env.cpp @@ -49,7 +49,10 @@ extern "C" EXPORT void env_create(ExtVMFace* _env, i256* io_gas, i256* _endowment, byte* _initBeg, uint64_t _initSize, h256* o_address) { - assert(_env->depth < 1024); // TODO: Handle call depth + if (_env->depth == 1024) + jit::terminate(jit::ReturnCode::OutOfGas); + + assert(_env->depth < 1024); auto endowment = llvm2eth(*_endowment);