From 6e318f881609da7507250929abf2f014de939066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 12 Dec 2014 18:51:53 +0100 Subject: [PATCH] Check current call depth --- libevmjit-cpp/Env.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libevmjit-cpp/Env.cpp b/libevmjit-cpp/Env.cpp index 451bce043..1a2442791 100644 --- a/libevmjit-cpp/Env.cpp +++ b/libevmjit-cpp/Env.cpp @@ -49,6 +49,8 @@ extern "C" EXPORT void env_create(ExtVMFace* _env, i256* _endowment, byte* _initBeg, uint64_t _initSize, h256* o_address) { + assert(_env->depth < 1024); // TODO: Handle call depth + auto endowment = llvm2eth(*_endowment); if (_env->balance(_env->myAddress) >= endowment) @@ -65,6 +67,8 @@ extern "C" EXPORT bool env_call(ExtVMFace* _env, i256* io_gas, h256* _receiveAddress, i256* _value, byte* _inBeg, uint64_t _inSize, byte* _outBeg, uint64_t _outSize, h256* _codeAddress) { + assert(_env->depth < 32); // TODO: Handle call depth + auto value = llvm2eth(*_value); if (_env->balance(_env->myAddress) >= value) {