Skip to content

Commit

Permalink
Fix Struct Pass-By-Val crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Naville committed Mar 20, 2020
1 parent 083a435 commit 934205b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions FunctionWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ struct FunctionWrapper : public ModulePass {
// Clang Intrinsic
return nullptr;
}
for(auto argiter = tmp->arg_begin(); argiter!= tmp->arg_end(); ++argiter) {
Argument& arg=*(argiter);
if(arg.hasByValAttr()){
// Arguments with byval attribute yields issues without proper handling.
// The "proper" method to handle this is to revisit and patch attribute stealing code.
// Technically readonly attr probably should also get filtered out here.

// Nah too much work. This would do for open-source version since private already
// this pass with more advanced solutions
return nullptr;
}
}
}
// Create a new function which in turn calls the actual function
vector<Type *> types;
Expand Down

0 comments on commit 934205b

Please sign in to comment.