1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00

Tentatively merge llvm fix for buildworld WITH_ASAN

Building world using WITH_ASAN results in an assertion when compiling
certain source files referencing ifuncs:

  Assertion failed: (isa<Function>(Callee) || isa<GlobalAlias>(Callee)), function analyzeAllUses, file /root/freebsd/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp, line 514.

This was already reported upstream a while ago, in
<https://github.com/llvm/llvm-project/issues/87923>, but now there is
finally a candidate fix, which seems trivial so I am importing it right
away.

Reported by:	markj
PR:		280936
Pull Request:	https://github.com/llvm/llvm-project/pull/113841
MFC after:	3 days
This commit is contained in:
Dimitry Andric 2024-10-28 18:33:49 +01:00
parent b8c3dd46bb
commit f3457ed942

View File

@ -528,7 +528,7 @@ void StackSafetyLocalAnalysis::analyzeAllUses(Value *Ptr,
// dso_preemptable aliases or aliases with interposable linkage.
const GlobalValue *Callee =
dyn_cast<GlobalValue>(CB.getCalledOperand()->stripPointerCasts());
if (!Callee) {
if (!Callee || isa<GlobalIFunc>(Callee)) {
US.addRange(I, UnknownRange, /*IsSafe=*/false);
break;
}