llvm-project
a56ca1a0 - [clang][codegen] Fix possible crash when setting TBAA metadata on FP math libcalls (#108575)

Commit
1 year ago
[clang][codegen] Fix possible crash when setting TBAA metadata on FP math libcalls (#108575) There's currently no code path that can reach this crash, but: ``` Instruction *Inst = cast<llvm::Instruction>(Call.getScalarVal()); ``` fails if the call returns `void`. This could happen if a builtin for something like `void sincos(double, double*, double*)` is added to clang. Instead, use the `llvm::CallBase` returned from `EmitCall()` to set the TBAA metadata, which should exist no matter the return type.
Author
Parents
Loading