Skip to content

Commit 54b74f1

Browse files
committed
Remove _DbgBreak dependency in gcinfohelpers.h
Remove assert(false) from Interp_NOMEM
1 parent 4007a9a commit 54b74f1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/coreclr/gcinfo/gcinfohelpers.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66
// because safemath verifies that you've actually performed overflow checks and there's a load-bearing assert somewhere in GcInfoEncoder
77
// It is not possible to use libc assert here without linker errors.
88
static bool __gcinfo_assert_hack_global = false;
9+
#ifdef _MSC_VER
910
#define GCINFO_ASSERT(expr) if (!(__gcinfo_assert_hack_global = (expr))) { \
10-
_DbgBreak();\
11+
__debugbreak(); \
1112
}
12-
#else
13+
#else // _MSC_VER
14+
#define GCINFO_ASSERT(expr) if (!(__gcinfo_assert_hack_global = (expr))) { \
15+
__builtin_trap(); \
16+
}
17+
#endif // _MSC_VER
18+
#else // _DEBUG
1319
#define GCINFO_ASSERT(expr) (void)0
14-
#endif
20+
#endif // _DEBUG
1521

1622
// If you want GcInfoEncoder logging to work, replace this macro with an appropriate definition.
1723
// This previously relied on our common logging infrastructure, but that caused linker failures in the interpreter.

src/coreclr/interpreter/compiler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ static const char *g_stackTypeString[] = { "I4", "I8", "R4", "R8", "O ", "VT", "
3737
/*****************************************************************************/
3838
void DECLSPEC_NORETURN Interp_NOMEM()
3939
{
40-
assert(false);
4140
// Ensure we don't return and that the compiler knows we won't
4241
#ifdef _MSC_VER
4342
__debugbreak();

0 commit comments

Comments
 (0)