Fix InsertFeedingExtract rule when extract remains.
authorGreg Fischer <greg@lunarg.com>
Mon, 12 Mar 2018 22:53:58 +0000 (16:53 -0600)
committerSteven Perron <31666470+s-perron@users.noreply.github.com>
Tue, 13 Mar 2018 02:06:23 +0000 (22:06 -0400)
source/opt/folding_rules.cpp

index 6b22ae0..a0fca0f 100644 (file)
@@ -1425,7 +1425,7 @@ FoldingRule InsertFeedingExtract() {
            {cinst->GetSingleWordInOperand(kInsertObjectIdInIdx)}});
       for (; i < inst->NumInOperands(); ++i) {
         operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER,
-                            {cinst->GetSingleWordInOperand(i)}});
+                            {inst->GetSingleWordInOperand(i)}});
       }
       inst->SetInOperands(std::move(operands));
       return true;