mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Fixed a crash when cloning a function into a function with
different size argument list and without attributes in the arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cc22640c4c
commit
784ae47413
@ -94,9 +94,12 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
//Some arguments were deleted with the VMap. Copy arguments one by one
|
||||
for (Function::const_arg_iterator I = OldFunc->arg_begin(),
|
||||
E = OldFunc->arg_end(); I != E; ++I)
|
||||
if (Argument* Anew = dyn_cast<Argument>(VMap[I]))
|
||||
Anew->addAttr(OldFunc->getAttributes()
|
||||
.getParamAttributes(I->getArgNo() + 1));
|
||||
if (Argument* Anew = dyn_cast<Argument>(VMap[I])) {
|
||||
AttributeSet attrs = OldFunc->getAttributes()
|
||||
.getParamAttributes(I->getArgNo() + 1);
|
||||
if (attrs.getNumSlots() > 0)
|
||||
Anew->addAttr(attrs);
|
||||
}
|
||||
NewFunc->setAttributes(NewFunc->getAttributes()
|
||||
.addAttributes(NewFunc->getContext(),
|
||||
AttributeSet::ReturnIndex,
|
||||
|
Loading…
x
Reference in New Issue
Block a user