[mlir][Python] fix liveContextMap under free-threading after #178529 (#179163)

#178529 introduced a small bug under free-threading by bumping a
reference count (or something like that) when accessing the operand list
passed to `build_generic`. This PR fixes that.
This commit is contained in:
Maksim Levental 2026-02-02 00:08:51 -05:00 committed by GitHub
parent bb14eabaca
commit 496d871ff3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1671,7 +1671,7 @@ nb::object PyOpView::buildGeneric(
int segmentSpec = operandSegmentSpec[i];
if (segmentSpec == 1 || segmentSpec == 0) {
// Unpack unary element.
const auto operand = operandList[i];
const nanobind::handle operand = operandList[i];
if (!operand.is_none()) {
try {
operands.push_back(getOpResultOrValue(operand));