From 72368d5050b56c521f5c78a7861302c531f7291a 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index d3d1022e1c..37dada8768 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -3284,7 +3284,8 @@ 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())