Skip to content

Commit 94783a8

Browse files
authored
[mlir][mesh] Exit after signalPassFailure to fix a crash (#132662)
Fixes #131435.
1 parent 9977071 commit 94783a8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mlir/lib/Dialect/Mesh/Transforms/ShardingPropagation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ struct ShardingPropagation
369369
OpBuilder builder(ctx);
370370
if (!region.hasOneBlock()) {
371371
funcOp.emitOpError() << "only one block is supported!";
372-
signalPassFailure();
372+
return signalPassFailure();
373373
}
374374
Block &block = region.front();
375375

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// RUN: mlir-opt --pass-pipeline="builtin.module(func.func(sharding-propagation))" %s -verify-diagnostics
2+
3+
// expected-error @+1 {{'func.func' op only one block is supported!}}
4+
func.func private @no_block_function(i64)

0 commit comments

Comments
 (0)