Skip to content

Commit

Permalink
[ArgPromotion] Fix a truncated variable
Browse files Browse the repository at this point in the history
This fixes a regression since SVN rev 273808 (which was supposed to
not change functionality).

The regression caused miscompilations (noted in the wild when targeting
AArch64) on platforms with 32 bit long.

Differential Revision: https://reviews.llvm.org/D32850

llvm-svn: 302137
  • Loading branch information
mstorsjo committed May 4, 2017
1 parent 9e2fea1 commit e81233d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Expand Up @@ -247,7 +247,7 @@ doPromotion(Function *F, SmallPtrSetImpl<Argument *> &ArgsToPromote,
if (!ArgIndex.second.empty()) {
Ops.reserve(ArgIndex.second.size());
Type *ElTy = V->getType();
for (unsigned long II : ArgIndex.second) {
for (auto II : ArgIndex.second) {
// Use i32 to index structs, and i64 for others (pointers/arrays).
// This satisfies GEP constraints.
Type *IdxTy =
Expand Down

0 comments on commit e81233d

Please sign in to comment.