Fix error when exception in object init led to the runtime crash. (#3221)

This commit is contained in:
Nikolay Igotti
2019-07-25 19:02:19 +03:00
committed by GitHub
parent 70872854ad
commit 80480fc3d7
+1 -1
View File
@@ -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<uintptr_t>(value) > 1) {
UPDATE_REF_EVENT(memoryState, value, nullptr, location, 0);
*location = nullptr;
ReleaseHeapRef(value);