Skip to content

Commit

Permalink
[mlir] Fix use-after-free introduced in a9efcbf.
Browse files Browse the repository at this point in the history
  • Loading branch information
chsigg committed Jun 23, 2024
1 parent c19028f commit 48cf6b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,10 +2335,10 @@ SplitOp::apply(transform::TransformRewriter &rewriter,
};

auto checkFailureInSplitting =
[&](bool hasFailed, Location loc) -> DiagnosedSilenceableFailure {
[&](bool hasFailed, Operation *op) -> DiagnosedSilenceableFailure {
if (hasFailed) {
auto diag = emitDefiniteFailure() << "internal failure in splitting";
diag.attachNote(loc) << "target op";
diag.attachNote(op->getLoc()) << "target op";
return diag;
}
return DiagnosedSilenceableFailure::success();
Expand Down Expand Up @@ -2376,7 +2376,7 @@ SplitOp::apply(transform::TransformRewriter &rewriter,

// Propagate errors.
DiagnosedSilenceableFailure diag =
checkFailureInSplitting(!head && !tail, target->getLoc());
checkFailureInSplitting(!head && !tail, target);
if (diag.isDefiniteFailure())
return diag;

Expand Down Expand Up @@ -2408,8 +2408,8 @@ SplitOp::apply(transform::TransformRewriter &rewriter,
getDimension(), std::get<1>(pair));

// Propagate errors.
DiagnosedSilenceableFailure diagSplit = checkFailureInSplitting(
!first.back() && !second.back(), target->getLoc());
DiagnosedSilenceableFailure diagSplit =
checkFailureInSplitting(!first.back() && !second.back(), target);
if (diagSplit.isDefiniteFailure())
return diag;

Expand Down

0 comments on commit 48cf6b6

Please sign in to comment.