File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -5765,7 +5765,9 @@ void IRGenSILFunction::visitBeginUnpairedAccessInst(
5765
5765
// in which case we should use the caller, which is generally ok because
5766
5766
// materializeForSet can't usually be thunked.
5767
5767
llvm::Value *pc;
5768
- if (hasBeenInlined (access)) {
5768
+ // Wasm doesn't have returnaddress because it can't access call frame
5769
+ // for security purposes
5770
+ if (IGM.Triple .isWasm () || hasBeenInlined (access)) {
5769
5771
pc = llvm::ConstantPointerNull::get (IGM.Int8PtrTy );
5770
5772
} else {
5771
5773
auto retAddrFn =
Original file line number Diff line number Diff line change 42
42
#elif _MSC_VER
43
43
#include < intrin.h>
44
44
#define get_return_address () _ReturnAddress()
45
+ #elif defined(__wasm__)
46
+ // Wasm can't access call frame for security purposes
47
+ #define get_return_address () ((void *) 0 )
45
48
#else
46
49
#error missing implementation for get_return_address
47
50
#define get_return_address () ((void *) 0 )
You can’t perform that action at this time.
0 commit comments