Skip to content

Commit 5935ee3

Browse files
committed
fiber_entryPoint() is noreturn
1 parent ab57e77 commit 5935ee3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

druntime/src/core/thread/fiber/base.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ package
2727
import core.exception : onOutOfMemoryError;
2828
import core.stdc.stdlib : abort;
2929

30-
extern (C) void fiber_entryPoint() nothrow
30+
extern (C) noreturn fiber_entryPoint() nothrow
3131
{
3232
FiberBase obj = FiberBase.getThis();
3333
assert( obj );
@@ -51,6 +51,8 @@ package
5151

5252
obj.m_state = Fiber.State.TERM;
5353
obj.switchOut();
54+
55+
assert(false, "It is impossible to return from switchOut");
5456
}
5557
}
5658

@@ -173,8 +175,6 @@ package
173175
*
174176
* The ARM implementation is meant to be used as a kind of documented example implementation.
175177
* Look there for a concrete example.
176-
*
177-
* FIXME: fiber_entrypoint might benefit from a @noreturn attribute, but D doesn't have one.
178178
*/
179179

180180
/**

druntime/src/core/thread/fiber/package.d

-2
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,6 @@ package
497497
*
498498
* The ARM implementation is meant to be used as a kind of documented example implementation.
499499
* Look there for a concrete example.
500-
*
501-
* FIXME: fiber_entrypoint might benefit from a @noreturn attribute, but D doesn't have one.
502500
*/
503501

504502
/**

0 commit comments

Comments
 (0)