Skip to content

Commit

Permalink
Fix returned objects by value attributed with inalloca
Browse files Browse the repository at this point in the history
For more details see https://llvm.org/docs/InAlloca.html. This specific crash happened on Win 32 only.

Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Jun 18, 2019
1 parent 1fc1b4e commit 72368d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CppParser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 72368d5

Please sign in to comment.