diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index e9bc61bb3b1..b3b5b40e242 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1380,7 +1380,7 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I, // Print out the -> operator if possible... if (TmpI != E && isa(*TmpI)) { Out << (HasImplicitAddress ? "." : "->"); - Out << "field" << cast(I.getOperand())->getValue(); + Out << "field" << cast(TmpI.getOperand())->getValue(); I = ++TmpI; } } diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index e9bc61bb3b1..b3b5b40e242 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -1380,7 +1380,7 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I, // Print out the -> operator if possible... if (TmpI != E && isa(*TmpI)) { Out << (HasImplicitAddress ? "." : "->"); - Out << "field" << cast(I.getOperand())->getValue(); + Out << "field" << cast(TmpI.getOperand())->getValue(); I = ++TmpI; } }