Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -3514,6 +3514,8 @@ shared static this()

private
{
extern extern (C) __gshared bool rt_trapExceptions;

extern (C) void fiber_entryPoint()
{
Fiber obj = Fiber.getThis();
Expand All @@ -3524,13 +3526,21 @@ private
obj.m_ctxt.tstack = obj.m_ctxt.bstack;
obj.m_state = Fiber.State.EXEC;

try

if (rt_trapExceptions)
{
obj.run();
try
{
obj.run();
}
catch( Throwable t )
{
obj.m_unhandled = t;
}
}
catch( Throwable t )
else
{
obj.m_unhandled = t;
obj.run();
}

static if( __traits( compiles, ucontext_t ) )
Expand Down