This was causing a subsequent assert/crash when a type converter failed to convert a block argument.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D110985
block, converter, *conversion, mapping, argReplacements)
: argConverter.convertSignature(block, converter, mapping,
argReplacements);
+ if (failed(result))
+ return failure();
if (Block *newBlock = result.getValue()) {
if (newBlock != block)
blockActions.push_back(BlockAction::getTypeConversion(newBlock));
}) : () -> ()
return
}
+
+// -----
+
+// Should not segfault here but gracefully fail.
+// CHECK-LABEL: func @test_block_argument_not_converted
+func @test_block_argument_not_converted() {
+ "test.unsupported_block_arg_type"() ({
+ // NOTE: The test pass does not convert `index` types.
+ // CHECK: ^bb0({{.*}}: index):
+ ^bb0(%0 : index):
+ "test.return"(%0) : (index) -> ()
+ }) : () -> ()
+ return
+}