Skip to content

Commit 65da1ed

Browse files
authored
Merge pull request swiftlang#73137 from mikeash/unreachable-improvements
[Runtime] Make swift_unreachable more debuggable by trapping immediately.
2 parents 909c9c1 + f61366b commit 65da1ed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/swift/Basic/Unreachable.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@
3535

3636
#include "swift/Runtime/Config.h"
3737

38-
SWIFT_RUNTIME_ATTRIBUTE_NORETURN
38+
SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_ALWAYS_INLINE
3939
inline static void swift_unreachable(const char *msg) {
40-
assert(false && msg);
4140
(void)msg;
42-
abort();
41+
SWIFT_RUNTIME_BUILTIN_TRAP;
4342
}
4443

4544
#endif

0 commit comments

Comments
 (0)