[Mlir-commits] [mlir] [mlir][BytecodeReader] Fix crash reading FusedLoc with empty locations (PR #189228)
Jacques Pienaar
llvmlistbot at llvm.org
Mon Apr 6 20:55:34 PDT 2026
================
@@ -116,19 +116,23 @@ def FileLineColLoc : DialectAttribute<(attr
}
}
-let cType = "FusedLoc",
- cBuilder = "cast<FusedLoc>(getChecked<FusedLoc>([&]() { return reader.emitError(); }, context, $_args))" in {
+let cType = "FusedLoc" in {
def FusedLoc : DialectAttribute<(attr
Array<Location>:$locations
)> {
let printerPredicate = "!$_val.getMetadata()";
+ // FusedLoc::get(context, locs) may return UnknownLoc when locs is empty.
+ // Pass Attribute() explicitly to bypass the folding logic and always
----------------
jpienaar wrote:
FusedLoc's folding may have been a bad idea those years ago :)
https://github.com/llvm/llvm-project/pull/189228
More information about the Mlir-commits
mailing list