From cfdbc48ad28f3ae39a05fd19117483abf8336f15 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Mon, 1 Dec 2025 16:22:03 +0100 Subject: [PATCH] fix --- ortools/linear_solver/python/model_builder_helper.cc | 8 ++++---- ortools/sat/python/cp_model_helper.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ortools/linear_solver/python/model_builder_helper.cc b/ortools/linear_solver/python/model_builder_helper.cc index 5d361c3246..ed12480e8d 100644 --- a/ortools/linear_solver/python/model_builder_helper.cc +++ b/ortools/linear_solver/python/model_builder_helper.cc @@ -332,14 +332,14 @@ bool was_optimized_in_function_call(PyObject* op) { bool IsOnwedExclusivelyThroughPyBind11(PyObject* op) { #if !defined(Py_GIL_DISABLED) - return Py_REFCNT(ob) == 3; + return Py_REFCNT(op) == 3; #else // NOTE: the entire ob_ref_shared field must be zero, including flags, to // ensure that other threads cannot concurrently create new references to // this object. - return (_Py_IsOwnedByCurrentThread(ob) && - _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local) == 3 && - _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared) == 0); + return (_Py_IsOwnedByCurrentThread(op) && + _Py_atomic_load_uint32_relaxed(&op->ob_ref_local) == 3 && + _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared) == 0); #endif } diff --git a/ortools/sat/python/cp_model_helper.cc b/ortools/sat/python/cp_model_helper.cc index 0661ba717e..822d6f7392 100644 --- a/ortools/sat/python/cp_model_helper.cc +++ b/ortools/sat/python/cp_model_helper.cc @@ -1137,14 +1137,14 @@ bool was_optimized_in_function_call(PyObject* op) { bool IsOnwedExclusivelyThroughPyBind11(PyObject* op) { #if !defined(Py_GIL_DISABLED) - return Py_REFCNT(ob) == 3; + return Py_REFCNT(op) == 3; #else // NOTE: the entire ob_ref_shared field must be zero, including flags, to // ensure that other threads cannot concurrently create new references to // this object. - return (_Py_IsOwnedByCurrentThread(ob) && - _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local) == 3 && - _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared) == 0); + return (_Py_IsOwnedByCurrentThread(op) && + _Py_atomic_load_uint32_relaxed(&op->ob_ref_local) == 3 && + _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared) == 0); #endif }