mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Fix address sanitizer to work on MachO targets (e.g. MacOS).
This commit is contained in:
committed by
Christoffer Lerno
parent
2b90500c22
commit
61c67c8f23
@@ -78,6 +78,7 @@ LLVMValueRef LLVMConstBswap(LLVMValueRef ConstantVal);
|
||||
void LLVMBuilderSetFastMathFlags(LLVMBuilderRef Builder, FastMathOption option);
|
||||
void LLVMSetDSOLocal(LLVMValueRef Global, bool value);
|
||||
void LLVMSetTargetMachineUseInitArray(LLVMTargetMachineRef ref, bool use_init_array);
|
||||
void LLVMSetNoSanitizeAddress(LLVMValueRef Global);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -318,6 +318,13 @@ void LLVMSetDSOLocal(LLVMValueRef Global, bool value)
|
||||
llvm::unwrap<llvm::GlobalValue>(Global)->setDSOLocal(value);
|
||||
}
|
||||
|
||||
void LLVMSetNoSanitizeAddress(LLVMValueRef Global)
|
||||
{
|
||||
auto global = llvm::unwrap<llvm::GlobalValue>(Global);
|
||||
auto data = global->getSanitizerMetadata();
|
||||
data.NoAddress = 1;
|
||||
global->setSanitizerMetadata(data);
|
||||
}
|
||||
void LLVMBuilderSetFastMathFlags(LLVMBuilderRef Builder, FastMathOption option)
|
||||
{
|
||||
llvm::FastMathFlags math_flags {};
|
||||
|
||||
Reference in New Issue
Block a user