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 <dpldobrev@protonmail.com>
  • Loading branch information
ddobrev committed Jun 18, 2019
1 parent 1fc1b4e commit 8ba8553
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CppParser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8ba8553

Please sign in to comment.