You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
We found a problem with the handling of the call instruction in this place, where the type of argument to the calling function is changed, but the call instruction is removed in the end.
newTarget = newGetElementPtr;
bool is_erased = false;
if (dyn_cast<ArrayType>(newType) || dyn_cast<PointerType>(newType)) {
Type* temp_newType = getElementType(newType);
Type* temp_oldType = getElementType(oldType);
is_erased = Transformer::transform(it, newTarget, oldTarget, temp_newType, temp_oldType, alignment);
}
else if (CallInst* callInst = dyn_cast<CallInst>(*it)) {
errs() << "====a call from getElementPtr\n";
BitCastInst *bitCast = new BitCastInst(newTarget, oldGetElementPtr->getType(), "", callInst);
bitCast->dump();
for (unsigned i = 0; i < callInst->getNumOperands(); i++) {
if (callInst->getOperand(i) == oldGetElementPtr)
callInst->setArgOperand(i, bitCast);
}
}
else {
if (newType->getTypeID() != oldType->getTypeID()) {
is_erased = Transformer::transform(it, newTarget, oldTarget, newType, oldType, alignment);
}
else {
// no further changes, but make sure we don't delete instruction!
is_erased = true;
}
}
if (!is_erased) {
erase.push_back(dyn_cast<Instruction>(*it));
}
}
The text was updated successfully, but these errors were encountered:
Hi,
We found a problem with the handling of the
call
instruction in this place, where the type of argument to the calling function is changed, but the call instruction is removed in the end.The text was updated successfully, but these errors were encountered: