Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4862ab7

Browse files
committed
Sheesh -- repair the dodge around "cast isn't an lvalue" complaints to
restore correct semantics.
1 parent 9e897f4 commit 4862ab7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Objects/stringobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ PyString_FromStringAndSize(const char *str, int size)
7575
if (size == 0) {
7676
PyObject *t = (PyObject *)op;
7777
PyString_InternInPlace(&t);
78+
op = (PyStringObject *)t;
7879
nullstring = op;
7980
Py_INCREF(op);
8081
} else if (size == 1 && str != NULL) {
8182
PyObject *t = (PyObject *)op;
8283
PyString_InternInPlace(&t);
84+
op = (PyStringObject *)t;
8385
characters[*str & UCHAR_MAX] = op;
8486
Py_INCREF(op);
8587
}
@@ -131,11 +133,13 @@ PyString_FromString(const char *str)
131133
if (size == 0) {
132134
PyObject *t = (PyObject *)op;
133135
PyString_InternInPlace(&t);
136+
op = (PyStringObject *)t;
134137
nullstring = op;
135138
Py_INCREF(op);
136139
} else if (size == 1) {
137140
PyObject *t = (PyObject *)op;
138141
PyString_InternInPlace(&t);
142+
op = (PyStringObject *)t;
139143
characters[*str & UCHAR_MAX] = op;
140144
Py_INCREF(op);
141145
}

0 commit comments

Comments
 (0)