summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-12-12 15:33:18 -0500
committerAlexey Bataev <a.bataev@hotmail.com>2019-12-12 15:48:33 -0500
commit5ad52587ec182f03636649e2cb66a0a4d9ffeab2 (patch)
tree53e0b72e47f11fee9391b4d2397faf305c3d545b /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parent8963332c3327daa652ba3e26d35f9109b6991985 (diff)
downloadbcm5719-llvm-5ad52587ec182f03636649e2cb66a0a4d9ffeab2.tar.gz
bcm5719-llvm-5ad52587ec182f03636649e2cb66a0a4d9ffeab2.zip
[OPENMP50]Fix possible conflict when emitting an alias for the functions
in declare variant. If the types of the fnction are not equal, but match, at the codegen thei may have different types. This may lead to compiler crash.
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index e3e9bd4284c..1aae18b4504 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1280,7 +1280,7 @@ bool CGOpenMPRuntime::tryEmitDeclareVariant(const GlobalDecl &NewGD,
llvm::GlobalValue *Addr = CGM.GetGlobalValue(NewMangledName);
if (Addr && !Addr->isDeclaration()) {
const auto *D = cast<FunctionDecl>(OldGD.getDecl());
- const CGFunctionInfo &FI = CGM.getTypes().arrangeGlobalDeclaration(OldGD);
+ const CGFunctionInfo &FI = CGM.getTypes().arrangeGlobalDeclaration(NewGD);
llvm::Type *DeclTy = CGM.getTypes().GetFunctionType(FI);
// Create a reference to the named value. This ensures that it is emitted
OpenPOWER on IntegriCloud