From 8ba8553329ecb25d5a153f74c8d3a0747f885001 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 18 Jun 2019 15:09:04 +0300 Subject: [PATCH] Fix returned objects by value attributed with inalloca For more details see https://llvm.org/docs/InAlloca.html. This specific crash happened on Win 32 only. Signed-off-by: Dimitar Dobrev --- src/CppParser/Parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index d3d1022e1c..196964242d 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -3284,13 +3284,13 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F, return; auto& CGInfo = GetCodeGenFunctionInfo(codeGenTypes, FD); - F->isReturnIndirect = CGInfo.getReturnInfo().isIndirect(); + F->isReturnIndirect = CGInfo.getReturnInfo().isIndirect() || + CGInfo.getReturnInfo().isInAlloca(); unsigned Index = 0; for (const auto& Arg : CGInfo.arguments()) { - F->Parameters[Index++]->isIndirect = - Arg.info.isIndirect() && !Arg.info.getIndirectByVal(); + F->Parameters[Index++]->isIndirect = Arg.info.isIndirect(); } MarkValidity(F);