Ugh. Just don't use __assume on non-msvc/clang-pretending-to-be-msvc targets.

This commit is contained in:
Joshua 2025-03-26 18:52:48 -07:00
parent 8949a32752
commit 5175c6f68d
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -24,11 +24,7 @@
#define LUAU_UNLIKELY(x) __builtin_expect(x, 0)
#define LUAU_UNREACHABLE() __builtin_unreachable()
#define LUAU_DEBUGBREAK() __builtin_trap()
#ifdef __APPLE__
#define LUAU_ASSUME(x) (void)sizeof(!!(x))
#else
#define LUAU_ASSUME(x) __attribute__((assume(x)));
#endif
#endif
// LUAU_FALLTHROUGH is a C++11-compatible alternative to [[fallthrough]] for use in the VM library

View file

@ -236,7 +236,9 @@ reentry:
VM_START(); // starts the interpreter "loop"
while (true) {
#if VM_USE_CGOTO
dispatch:
#endif
// Note: this code doesn't always execute! on some platforms we use computed goto which bypasses all of this unless we run in single-step mode
// Therefore only ever put assertions here.
LUAU_ASSERT(base == L->base && L->base == L->ci->base);