Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/luaconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ static inline void lua_number2str(char *buf, LUA_NUMBER n)
** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
** and with longjmp/setjmp otherwise.
*/

#if defined(__cplusplus)
/* C++ exceptions */
#define LUAI_THROW(L,c) throw(c)
Expand Down
10 changes: 9 additions & 1 deletion src/thrlua.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,15 @@ struct lua_longjmp {
# define LUA_ASMNAME(x) _##x
#endif

#if LUA_ARCH_X86_64
/*
** Under AddressSanitizer, use system setjmp/longjmp so ASAN can
** intercept them and properly unpoison skipped stack frames.
** The custom asm versions bypass ASAN and cause false positives.
*/
#if defined(__SANITIZE_ADDRESS__)
# define lua_do_setjmp setjmp
# define lua_do_longjmp longjmp
#elif LUA_ARCH_X86_64
# define lua_do_setjmp LUA_ASMNAME(lua_setjmp_amd64)
# define lua_do_longjmp LUA_ASMNAME(lua_longjmp_amd64)
#elif LUA_ARCH_I386
Expand Down