summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 98bc942..ede8956 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -990,6 +990,9 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
}
assert(LoadedTy->isFirstClassType());
+ if (Indices.size() == 1)
+ Indices.clear(); // Do not generate load X, 0
+
Res = new LoadInst(NewVal, Indices, Name);
assert(Res->getType()->isFirstClassType() && "Load of structure or array!");
break;