Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Release boxed operands in tagged true division
  • Loading branch information
hauntsaninja committed Apr 16, 2026
commit a519cd906c1addd694c55a4e18c3725b2fb1fb52
8 changes: 7 additions & 1 deletion mypyc/lib-rt/int_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,15 @@ double CPyTagged_TrueDivide(CPyTagged x, CPyTagged y) {
PyObject *yo = CPyTagged_AsObject(y);
PyObject *result = PyNumber_TrueDivide(xo, yo);
if (result == NULL) {
Py_DECREF(xo);
Py_DECREF(yo);
return CPY_FLOAT_ERROR;
}
return PyFloat_AsDouble(result);
double value = PyFloat_AsDouble(result);
Py_DECREF(xo);
Py_DECREF(yo);
Py_DECREF(result);
return value;
}
return 1.0;
}
Expand Down
Loading