From 80480fc3d71595a60e7bbe7f5420177748914648 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Thu, 25 Jul 2019 19:02:19 +0300 Subject: [PATCH] Fix error when exception in object init led to the runtime crash. (#3221) --- runtime/src/main/cpp/Memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/cpp/Memory.cpp b/runtime/src/main/cpp/Memory.cpp index 4f6e836a65e..2fcf7202b97 100644 --- a/runtime/src/main/cpp/Memory.cpp +++ b/runtime/src/main/cpp/Memory.cpp @@ -1582,7 +1582,7 @@ void setHeapRef(ObjHeader** location, const ObjHeader* object) { void zeroHeapRef(ObjHeader** location) { MEMORY_LOG("ZeroHeapRef %p\n", location) auto* value = *location; - if (value != nullptr) { + if (reinterpret_cast(value) > 1) { UPDATE_REF_EVENT(memoryState, value, nullptr, location, 0); *location = nullptr; ReleaseHeapRef(value);