summaryrefslogtreecommitdiff
path: root/Parser
AgeCommit message (Collapse)AuthorLines
2019-03-28bpo-36459: Fix a possible double PyMem_FREE() due to tokenizer.c's ↵Miss Islington (bot)-1/+0
tok_nextc() (12601) Remove the PyMem_FREE() call added in cb90c89. The buffer will be freed when PyTokenizer_Free() is called on the tokenizer state. (cherry picked from commit cda139d1ded6708665b53e4ed32ccc1d2627e1da) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-03-20bpo-36367: Free buffer if realloc fails in tokenize.c (GH-12442) (GH-12470)Victor Stinner-2/+8
(cherry picked from commit cb90c89de14aab636739b3e810cf949e47b54a0c)
2019-03-19[2.7] bpo-18368: Fix memory leaks in PyOS_StdioReadline() when realloc() ↵stratakis-5/+17
fails (GH-12334) (cherry picked from commit 9ae513caa74a05970458dee17fb995ea49965bb5)
2018-09-10bpo-25083: Python can sometimes create incorrect .pyc files (GH-8449)tzickel-0/+5
Python 2 never checked for I/O error when reading .py files and thus could mistake an I/O error for EOF and create incorrect .pyc files. This adds an check for this and aborts on an error.
2018-08-22[2.7] bpo-34400: Fix more undefined behavior in parsetok.c (GH-8833). (GH-8849)Zackery Spytz-2/+4
(cherry picked from commit 3e26e42c905852394fa136f1cc564dac98b56166) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-08-15closes bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)Miss Islington (bot)-1/+1
Avoid undefined pointer arithmetic with NULL. (cherry picked from commit 7c4ab2afb17b99eb3f61f9c73cbd548b5e0ad2c0) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-31[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)Serhiy Storchaka-1/+1
2018-06-25bpo-27780: Make pgen.c C89 compliant (GH-7915)Zachary Ware-2/+3
2018-06-22make pgen.c C89 compliant again (GH-7870)Benjamin Peterson-1/+2
2018-06-22[2.7] properly free memory in pgen. (GH-7869) (closes bpo-27780Benjamin Peterson-2/+35
(cherry picked from commit 9ac11a752a19c3b8607582a3d5ccb615c467124b) Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-05-31bpo-33645: Fix an "unknown parsing error" in the parser. (GH-7119)Serhiy Storchaka-0/+2
It is reproduced when parse the "<>" operator and run Python with both options -3 and -We.
2017-08-04Fix a shadow-compatible-local warning (#2182)Yuan Chao Chou-3/+3
Change the shadowing naming, 'value' (Python-ast.c:3814), to 'val' to prevent the variables from being misused.
2017-02-20reinit the TLS before anything else (#130)Benjamin Peterson-1/+1
PyEval_ReInitThread can run arbitrary Python code, which really ought to have the TLS initialized.
2016-10-08Silenced compiler warnings.Serhiy Storchaka-2/+3
2016-10-07Issue #24098: Fixed possible crash when AST is changed in process ofSerhiy Storchaka-0/+7
compiling it.
2016-09-24Revert unintended commit to asdl_c.pyMartin Panter-1/+1
2016-09-24Fix incomplete format error in asdl.pyMartin Panter-2/+2
2016-09-18properly handle the single null-byte file (closes #24022)Benjamin Peterson-1/+1
2016-07-28Spelling and grammar fixes in code comments and documentationMartin Panter-1/+1
2016-06-21Issue #22463: Backport compiler warning fixes and workaroundsMartin Panter-0/+1
* Set but unused variable in Parser/pgen.c in non-debug builds. Patch by Christian Heimes. * Unused static function in Modules/readline.c. Patch by Georg Brandl. * main_window unused in Modules/tkappinit.c. Patch by Gregory P. Smith. * Dead assignment in Modules/_ctypes/cfield.c. Extracted from patch by Brett Cannon. * Expression result unused in PyObject_INIT macro expansions. Based on patches by Christian Heimes. * Load expat_config.h and therefore pyconfig.h before C stdlib headers are loaded. This silences pre-processor warnings including '_POSIX_C_SOURCE redefined'. Extracted from patch by Christian Heimes.
2015-11-14Issue #25388: Fixed tokenizer hang when processing undecodable source codeSerhiy Storchaka-3/+6
with a null byte.
2015-08-13add missing NULL checks to get_coding_spec (closes #24854)Benjamin Peterson-1/+4
2014-09-05Issue #22221: Backported fixes from Python 3 (issue #18960).Serhiy Storchaka-3/+17
* Now the source encoding declaration on the second line isn't effective if the first line contains anything except a comment. This affects compile(), eval() and exec() too. * IDLE now ignores the source encoding declaration on the second line if the first line contains anything except a comment. * 2to3 and the findnocoding.py script now ignore the source encoding declaration on the second line if the first line contains anything except a comment.
2014-06-17Issue #21789: fix broken link (reported by Jan Varho)Ned Deily-1/+1
2014-06-07allow the keyword else immediately after (no space) an integer (closes #21642)Benjamin Peterson-5/+14
2013-12-28complain if the codec doesn't return unicodeBenjamin Peterson-0/+6
2013-08-26#18803: fix more typos. Patch by Févry Thibault.Ezio Melotti-1/+1
2013-06-09Issue #18038: SyntaxError raised during compilation sources with illegalSerhiy Storchaka-7/+7
encoding now always contains an encoding name.
2012-12-13Make PyAST_obj2mod C89 compliant.Trent Nelson-3/+11
2012-09-30#15923: fix a mistake in asdl_c.py that resulted in a TypeError after ↵Ezio Melotti-1/+1
2801bf875a24 (see #15801).
2012-08-11Remove unused variables in parsetok().Georg Brandl-2/+1
2012-08-03Closes #15512: Correct __sizeof__ support for parserJesus Cea-0/+26
2012-07-03Issue #1677: Unused variable warning in Non-WindowsJesus Cea-0/+3
2012-07-03Backed out changeset 7ccc2cea6969Jesus Cea-3/+0
2012-07-03Issue #1667: Unused variable warning in Non-WindowsJesus Cea-0/+3
2012-06-29Issue #1677: Handle better a race condition between the interactive ↵Tim Golden-23/+16
interpreter and the Ctrl-C signal handler on Windows
2011-07-22allow None identifiersBenjamin Peterson-1/+1
2011-07-22verify the types of AST strings and identifiers (closes #12609 and #12610)Benjamin Peterson-2/+19
2011-07-22hardcode the old svn __version__Benjamin Peterson-5/+3
2011-05-30Issue #12016: my_fgets() now always clears errors before calling fgets(). FixVictor Stinner-0/+1
the following case: sys.stdin.read() stopped with CTRL+d (end of file), raw_input() interrupted by CTRL+c.
2011-05-10(Merge 3.1) Issue #1195: Fix input() if it is interrupted by CTRL+d and thenVictor Stinner-0/+1
CTRL+c, clear the end-of-file indicator after CTRL+d.
2011-04-09(Merge 3.1) Issue #11650: PyOS_StdioReadline() retries fgets() if it wasVictor Stinner-45/+49
interrupted (EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch written by Charles-Francois Natali.
2010-06-24Issue #9020: The Py_IS* macros from pyctype.h should generally only beStefan Krah-1/+1
used with signed/unsigned char arguments. For integer arguments, EOF has to be handled separately.
2010-06-22spacing nit; this isn't CBenjamin Peterson-1/+1
2010-06-09fix code formattingBenjamin Peterson-2/+3
2010-05-18Doc Fix. Correct link to Zephyr ASDL Abstract page.Senthil Kumaran-1/+1
2010-05-15Use 4-spaces for indentation (instead of tabs) in pgen outputsVictor Stinner-10/+10
Regenerate (reindent) Python/graminit.c
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-3247/+3247
2010-04-03use our own locale independent ctype macrosBenjamin Peterson-19/+3
requires building pyctype.o into pgen
2010-04-03ensure that the locale does not affect the tokenization of identifiersBenjamin Peterson-4/+18