Browse Source

Check current call depth

cl-refactor
Paweł Bylica 10 years ago
parent
commit
6e318f8816
  1. 4
      libevmjit-cpp/Env.cpp

4
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)
{

Loading…
Cancel
Save