Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 1768238

Browse files
authored
Merge pull request #2341 from JohanEngelen/patch-1
Dwarf EH: explicitly remove our reference to caught Throwable merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
2 parents 4387aca + 72df9d3 commit 1768238

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rt/dwarfeh.d

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ extern(C) Throwable __dmd_begin_catch(_Unwind_Exception* exceptionObject)
142142
//printf("__dmd_begin_catch(%p), object = %p\n", eh, eh.object);
143143

144144
auto o = eh.object;
145+
// Remove our reference to the exception. We should not decrease its refcount,
146+
// because we pass the object on to the caller.
147+
eh.object = null;
145148

146149
// Pop off of chain
147150
if (eh != ExceptionHeader.pop())

0 commit comments

Comments
 (0)