Commit d3dc6528 authored by chris's avatar chris

Chris...editing

parent a6dcacbe
...@@ -600,9 +600,6 @@ save_string(ARG(Picklerobject *, self), ARG(PyObject *, args)) ...@@ -600,9 +600,6 @@ save_string(ARG(Picklerobject *, self), ARG(PyObject *, args))
PyObject *py_string_id = 0, *memo_len = 0, *repr = 0; PyObject *py_string_id = 0, *memo_len = 0, *repr = 0;
char *repr_str, *c_str; char *repr_str, *c_str;
int size, len, p; int size, len, p;
long string_id;
string_id = (long)args;
if (!self->bin) if (!self->bin)
{ {
...@@ -624,6 +621,7 @@ save_string(ARG(Picklerobject *, self), ARG(PyObject *, args)) ...@@ -624,6 +621,7 @@ save_string(ARG(Picklerobject *, self), ARG(PyObject *, args))
free(c_str); free(c_str);
return NULL; return NULL;
} }
Py_XDECREF(repr);
} }
else else
{ {
...@@ -673,18 +671,24 @@ save_string(ARG(Picklerobject *, self), ARG(PyObject *, args)) ...@@ -673,18 +671,24 @@ save_string(ARG(Picklerobject *, self), ARG(PyObject *, args))
free(c_str); free(c_str);
UNLESS(py_string_id = PyInt_FromLong(0 /*string_id*/)) if(args->ob_refcnt > 1)
goto err; {
long string_id;
UNLESS(memo_len = PyInt_FromLong(PyDict_Size(self->memo))) string_id = (long)args;
goto err;
if (PyDict_SetItem(self->memo, py_string_id, memo_len) == -1) UNLESS(py_string_id = PyInt_FromLong(0 /*string_id*/))
goto err; goto err;
Py_DECREF(memo_len); UNLESS(memo_len = PyInt_FromLong(PyDict_Size(self->memo)))
Py_DECREF(py_string_id); goto err;
Py_XDECREF(repr);
if (PyDict_SetItem(self->memo, py_string_id, memo_len) == -1)
goto err;
Py_DECREF(memo_len);
Py_DECREF(py_string_id);
}
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
......
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