diff --git a/stdlib/public/runtime/Exclusivity.cpp b/stdlib/public/runtime/Exclusivity.cpp index e0cb4902c49b2..39a14d7329848 100644 --- a/stdlib/public/runtime/Exclusivity.cpp +++ b/stdlib/public/runtime/Exclusivity.cpp @@ -37,14 +37,14 @@ #include // Pick a return-address strategy -#if __GNUC__ +#if defined(__wasm__) +// Wasm can't access call frame for security purposes +#define get_return_address() ((void*) 0) +#elif __GNUC__ #define get_return_address() __builtin_return_address(0) #elif _MSC_VER #include #define get_return_address() _ReturnAddress() -#elif defined(__wasm__) -// Wasm can't access call frame for security purposes -#define get_return_address() ((void*) 0) #else #error missing implementation for get_return_address #define get_return_address() ((void*) 0)