| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC says:
../cpython/Python/marshal.c: In function ‘PyMarshal_WriteLongToFile’:
../cpython/Python/marshal.c:70:35: warning: ‘wf.ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
^~
../cpython/Python/marshal.c:70:47: warning: ‘wf.end’ may be used uninitialized in this function [-Wmaybe-uninitialized]
else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
^~
../cpython/Python/marshal.c:77:10: warning: ‘wf.str’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (p->str == NULL)
~^~~~~
This isn't a real problem because if the file pointer is not NULL, the
string-related fields are never touched. But, it doesn't hurt to set the unused
fields to NULL.
|
| |
|
| |
|
|
|
|
| |
with size >= 2**31), instead of producing illegal marshal data.
|
| |
|
|
|
|
|
|
| |
PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable
benefit compared to the dynamic memory allocation fallback. Patch by
Charles-François Natali.
|
| |
|
| |
|
|
|
|
| |
brings it more in line with py3k.
|
|
|
|
|
|
|
|
|
| |
This is in anticipation of possibly implementing issue 7117 (short float repr).
This removes the last calls to PyFloat_AsString, PyFloat_AsReprString, and
PyFloat_AsStringEx, which are unsafe.
Also, switch to defines for error values to bring this code more in line
with the py3k branch.
|
|
|
|
| |
PyLongs. Raise ValueError instead.
|
|
|
|
| |
from docstring.
|
| |
|
|
|
|
| |
Backport of r70459.
|
| |
|
| |
|
|
|
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
|
| |
|
|
|
|
| |
the size of the buffer more quickly.
|
| |
|
| |
|
| |
|
|
|
|
| |
creating an intermediate tuple).
|
| |
|
|
|
|
| |
Saves the unnecessary creation of a tuple as intermediate container.
|
|
|
|
| |
candidate).
|
|
|
|
|
|
| |
would be accessed.
Will backport.
|
|
|
|
|
| |
4000 didn't work either. 1000 does work on Windows. If 2000 works,
that will hopefully be a reasonable balance.
|
|
|
|
|
| |
crashes on Windows are really due to the stack size or possibly
some other problem.
|
|
|
|
|
| |
Windows and some other boxes. If this is successful, this rev should
be backported. I'm not sure how close to the limit we should push this.
|
|
|
|
|
|
| |
lack of an infinite recursion check.
Contributed by Damien Miller at Google.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unified the way intobject, longobject and mystrtoul handle
values around -sys.maxint-1.
* in general, trying to entierely avoid overflows in any computation
involving signed ints or longs is extremely involved. Fixed a few
simple cases where a compiler might be too clever (but that's all
guesswork).
* more overflow checks against bad data in marshal.c.
* 2.5 specific: fixed a number of places that were still confusing int
and Py_ssize_t. Some of them could potentially have caused
"real-world" breakage.
* list.pop(x): fixing overflow issues on x was messy. I just reverted
to PyArg_ParseTuple("n"), which does the right thing. (An obscure
test was trying to give a Decimal to list.pop()... doesn't make
sense any more IMHO)
* trying to write a few tests...
|
|
|
|
|
|
|
|
| |
However, there was no error checking that PyFloat_FromDouble returned
a valid pointer. I believe this change is correct as it seemed
to follow other code in the area.
Klocwork # 292.
|
| |
|
|
|
|
|
| |
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
|
| |
|
| |
|
|
|
|
|
| |
(PyMarshal_ReadShortFromFile() is only used in zipimport.c, I don't believe
the extra initializations will matter one way or another.)
|
| |
|
| |
|
|
|
|
| |
Probably should be backported.
|
| |
|
|
|
|
| |
Remove duplicate declarations from compile.h
|
|
|
|
|
|
|
|
|
|
| |
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
[ 1180997 ] lax error-checking in new-in-2.4 marshal stuff
which I'd assigned to Martin, but actually turned out to be easy to fix.
Also, a test.
|
|
|
|
|
|
| |
marshal_loads.
Bugfix candidate.
|
| |
|
|
|
|
|
|
|
|
|
| |
[ 1180995 ] binary formats for marshalling floats
Adds 2 new type codes for marshal (binary floats and binary complexes), a
new marshal version (2), updates MAGIC and fiddles the de-serializing of
code objects to be less likely to clobber the real reason for failing if
it fails.
|