From bae0a2b2a08da303345dd280801fb88780529121 Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Mon, 28 Aug 2023 13:51:12 -0700 Subject: [PATCH] Fix error message if no device. We need to return with an error message, or later code will segfault. --- lib/Targets/AIETargetXAIEV2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Targets/AIETargetXAIEV2.cpp b/lib/Targets/AIETargetXAIEV2.cpp index 2496a969c1..5c0b3aa7fc 100644 --- a/lib/Targets/AIETargetXAIEV2.cpp +++ b/lib/Targets/AIETargetXAIEV2.cpp @@ -404,7 +404,7 @@ mlir::LogicalResult AIETranslateToXAIEV2(ModuleOp module, raw_ostream &output) { DenseMap switchboxes; if (module.getOps().empty()) { - module.emitOpError("expected AIE.device operation at toplevel"); + return module.emitOpError("expected AIE.device operation at toplevel"); } DeviceOp targetOp = *(module.getOps().begin()); const auto &target_model = targetOp.getTargetModel();