diff --git a/evmjit/libevmjit/Array.cpp b/evmjit/libevmjit/Array.cpp index 21de061c6..92ba6193d 100644 --- a/evmjit/libevmjit/Array.cpp +++ b/evmjit/libevmjit/Array.cpp @@ -239,7 +239,9 @@ Array::Array(llvm::IRBuilder<>& _builder, llvm::Value* _array) : m_setFunc([this](){ return createArraySetFunc(); }), m_getFunc([this](){ return createArrayGetFunc(); }), m_freeFunc([this](){ return createFreeFunc(); }) -{} +{ + m_builder.CreateStore(llvm::ConstantAggregateZero::get(getType()), m_array); +} void Array::pop(llvm::Value* _count) diff --git a/evmjit/libevmjit/Runtime.h b/evmjit/libevmjit/Runtime.h index 5b8052330..4fc1705c4 100644 --- a/evmjit/libevmjit/Runtime.h +++ b/evmjit/libevmjit/Runtime.h @@ -26,9 +26,9 @@ private: byte* m_memoryData = nullptr; i256 m_memorySize; public: - byte* m_memData = nullptr; // FIXME: Remember to free memory - uint64_t m_memSize = 0; // TODO: Init array in LLVM, to allow more optimization - uint64_t m_memCap = 0; + byte* m_memData; // FIXME: Remember to free memory + uint64_t m_memSize; + uint64_t m_memCap; }; }