Skip to content

Commit

Permalink
Fix incorrect # of replacement values assert for debug builds (#283)
Browse files Browse the repository at this point in the history
Fixes `incorrect # of replacement values assert` when testing a debug
build by correcting the number of values used when replacing an
operation.
  • Loading branch information
bcdonovan committed Mar 7, 2024
1 parent c1c6302 commit 99da528
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Dialect/QUIR/Transforms/MergeCircuitMeasures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ static void mergeMeasurements(PatternRewriter &rewriter,
measureOp.getLoc(), TypeRange(typeVec), ValueRange(valVec));

auto originalNumResults = measureOp->getNumResults();
rewriter.replaceOp(
measureOp, ResultRange(mergedOp.outs().begin(), mergedOp.outs().end()));
rewriter.replaceOp(measureOp,
ResultRange(mergedOp.result_begin(),
mergedOp.result_begin() + originalNumResults));

llvm::SmallVector<Type> outputTypes;
llvm::SmallVector<Value> outputValues;
Expand Down

0 comments on commit 99da528

Please sign in to comment.