Commit 2c4a68a6 authored by Boxiang Sun's avatar Boxiang Sun

minor refcounting fixing in long.__hash__

parent b5f3a74e
...@@ -1542,7 +1542,7 @@ bool longNonzeroUnboxed(BoxedLong* self) { ...@@ -1542,7 +1542,7 @@ bool longNonzeroUnboxed(BoxedLong* self) {
Box* longHash(BoxedLong* self) { Box* longHash(BoxedLong* self) {
if (!PyLong_Check(self)) if (!PyLong_Check(self))
raiseExcHelper(TypeError, "descriptor '__pow__' requires a 'long' object but received a '%s'", raiseExcHelper(TypeError, "descriptor '__hash__' requires a 'long' object but received a '%s'",
getTypeName(self)); getTypeName(self));
// If the long fits into an int we have to return the same hash in order that we can find the value in a dict. // If the long fits into an int we have to return the same hash in order that we can find the value in a dict.
...@@ -1568,7 +1568,7 @@ Box* longHash(BoxedLong* self) { ...@@ -1568,7 +1568,7 @@ Box* longHash(BoxedLong* self) {
long long_hash(PyObject* self) noexcept { long long_hash(PyObject* self) noexcept {
try { try {
return unboxInt(longHash((BoxedLong*)self)); return unboxInt(autoDecref(longHash((BoxedLong*)self)));
} catch (ExcInfo e) { } catch (ExcInfo e) {
RELEASE_ASSERT(0, ""); RELEASE_ASSERT(0, "");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment