We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6d20bf commit 483f99aCopy full SHA for 483f99a
Python/marshal.c
@@ -90,7 +90,7 @@ typedef struct {
90
int version;
91
} WFILE;
92
93
-#define count_refs(p) ((p)->hashtable->nentries)
+#define count_refs(p) ((p)->hashtable ? (p)->hashtable->nentries : 0)
94
95
#define w_byte(c, p) do { \
96
if ((p)->ptr != (p)->end || w_reserve((p), 1)) \
@@ -1818,14 +1818,14 @@ marshal_load(PyObject *module, PyObject *file)
1818
rf.readable = file;
1819
rf.ptr = rf.end = NULL;
1820
rf.buf = NULL;
1821
+ rf.ctx = NULL;
1822
if ((rf.refs = PyList_New(0)) != NULL) {
1823
result = read_object(&rf);
1824
Py_DECREF(rf.refs);
1825
if (rf.buf != NULL)
1826
PyMem_Free(rf.buf);
1827
} else
1828
result = NULL;
- rf.ctx = NULL;
1829
}
1830
Py_DECREF(data);
1831
return result;
0 commit comments