summaryrefslogtreecommitdiff
path: root/Python/compile.c
AgeCommit message (Collapse)AuthorLines
2006-08-12Even though _Py_Mangle() isn't truly public anyone can call it andNeal Norwitz-2/+2
there was no verification that privateobj was a PyString. If it wasn't a string, this could have allowed a NULL pointer to creep in below and crash. I wonder if this should be PyString_CheckExact? Must identifiers be strings or can they be subclasses? Klocwork #275
2006-08-04Bug #1333982: string/number constants were inappropriately storedNeal Norwitz-2/+4
in the byte code and co_consts even if they were not used, ie immediately popped off the stack.
2006-08-04Bug #1191458: tracing over for loops now produces a line eventNeal Norwitz-7/+46
on each iteration. I'm not positive this is the best way to handle this. I'm also not sure that there aren't other cases where the lnotab is generated incorrectly. It would be great if people that use pdb or tracing could test heavily. Also: * Remove dead/duplicated code that wasn't used/necessary because we already handled the docstring prior to entering the loop. * add some debugging code into the compiler (#if 0'd out).
2006-07-30Add some asserts and update commentsNeal Norwitz-0/+1
2006-07-23If the for loop isn't entered, entryblock will be NULL. If passedNeal Norwitz-0/+2
to stackdepth_walk it will be dereffed. Not sure if I found with failmalloc or Klockwork #55.
2006-07-22Fix more memory allocation issues found with failmalloc.Neal Norwitz-13/+23
2006-07-21Handle more memory allocation failures without crashing.Neal Norwitz-0/+9
2006-07-16Bug #1512814, Fix incorrect lineno's when code within a functionNeal Norwitz-5/+6
had more than 255 blank lines. Byte codes need to go first, line #s second.
2006-07-10Bug #1512814, Fix incorrect lineno's when code at module scopeNeal Norwitz-1/+9
started after line 256.
2006-07-09Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.Neil Schemenauer-1/+2
2006-06-12Fix indentation of case and a Py_ssize_t issue.Neal Norwitz-2/+2
2006-06-04Patch #1346214: correctly optimize away "if 0"-style stmtsGeorg Brandl-14/+29
(thanks to Neal for review)
2006-05-26Replace Py_BuildValue("OO") by PyTuple_Pack.Georg Brandl-3/+3
2006-05-02Get rid of __context__, per the latest changes to PEP 343 and python-devGuido van Rossum-10/+3
discussion. There are two places of documentation that still mention __context__: Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without spending a whole lot of time thinking about it; and whatsnew, which Andrew usually likes to change himself.
2006-04-13Introduce asdl_int_seq, to hold cmpop_ty.Martin v. Löwis-10/+2
2006-04-13revert - breaks build of Python/ast.c w/ gccSkip Montanaro-2/+5
2006-04-13Use union to discriminate pointer types from enum/int types.Skip Montanaro-5/+2
2006-04-13casting nastiness to make C++ compiler happyAnthony Baxter-2/+10
2006-04-12per Jeremy's email, remove the _WITH_CAST versions of macros. g++Anthony Baxter-46/+24
still has errors from the casts of asdl_seq_GET to cmpop_ty, but otherwise it's C++ clean.
2006-04-11more low-hanging fruit to make code compile under a C++ compiler. NotAnthony Baxter-54/+85
entirely happy with the two new VISIT macros in compile.c, but I couldn't see a better approach.
2006-04-10Use PyObject_* allocator since FutureFeatures is smallNeal Norwitz-1/+1
2006-04-10Fix some warnings on HP-UX when using cc/aCCNeal Norwitz-4/+7
2006-04-04Generate line number table entries for except handlers.Jeremy Hylton-0/+2
Re-enable all the tests in test_trace.py except one. Still not sure that these tests test what they used to test, but they pass. One failing test seems to be caused by undocumented line number table behavior in Python 2.4.
2006-04-03Don't abbreviate ABS, use long name ABSOLUTE.Neal Norwitz-2/+2
2006-04-01Expand comments on line numbers and blocks.Jeremy Hylton-6/+21
Reorder compiler_set_lineno() call for consistency.
2006-03-17Fix some missing checks after PyTuple_New, PyList_New, PyDict_NewGeorg Brandl-1/+3
2006-03-13Fix SF bug #1448804 and ad a test to ensure that all subscript operations ↵Nick Coghlan-24/+29
continue to be handled correctly
2006-03-10Um, I thought I'd already checked this in.Guido van Rossum-3/+1
Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
2006-03-03SF bug 1442442: LIST_APPEND optimization got lost in the AST merge.Neal Norwitz-3/+4
Add it back.
2006-03-02Fix refleak if from __future__ import was not firstNeal Norwitz-0/+1
2006-03-02Update known issues to reflect realityNeal Norwitz-4/+1
2006-03-01Patch #1440601: Add col_offset attribute to AST nodes.Martin v. Löwis-2/+2
2006-03-01Tabify and reflow some long lines.Jeremy Hylton-693/+699
Much of the peephole optimizer is now indented badly, but it's about to be revised anyway.
2006-02-28Generally inehrit codeflags that are in PyCF_MASK, instead of writing it outThomas Wouters-4/+4
in multiple places. This makes compile()/eval()/etc also inherit the absolute-import codeflag, like division and with-statement already were.
2006-02-28from __future__ import with_statement addon for 'with', mostly written byThomas Wouters-0/+2
Neal.
2006-02-28SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters-0/+27
- IMPORT_NAME takes an extra argument from the stack: the relativeness of the import. Only passed to __import__ when it's not -1. - __import__() takes an optional 5th argument for the same thing; it __defaults to -1 (old semantics: try relative, then absolute) - 'from . import name' imports name (be it module or regular attribute) from the current module's *package*. Likewise, 'from .module import name' will import name from a sibling to the current module. - Importing from outside a package is not allowed; 'from . import sys' in a toplevel module will not work, nor will 'from .. import sys' in a (single-level) package. - 'from __future__ import absolute_import' will turn on the new semantics for import and from-import: imports will be absolute, except for from-import with dots. Includes tests for regular imports and importhooks, parser changes and a NEWS item, but no compiler-package changes or documentation changes.
2006-02-27Clarify C-style exception handling with proper label name.Thomas Wouters-3/+3
2006-02-27Fix assertions.Thomas Wouters-3/+3
2006-02-27PEP 343 -- the with-statement.Guido van Rossum-4/+162
This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).
2006-02-27PEP 308 implementation, including minor refdocs and some testcases. ItThomas Wouters-0/+26
breaks the parser module, because it adds the if/else construct as well as two new grammar rules for backward compatibility. If no one else fixes parsermodule, I guess I'll go ahead and fix it later this week. The TeX code was checked with texcheck.py, but not rendered. There is actually a slight incompatibility: >>> (x for x in lambda:0) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: iteration over non-sequence changes into >>> (x for x in lambda: 0) File "<stdin>", line 1 (x for x in lambda: 0) ^ SyntaxError: invalid syntax Since there's no way the former version can be useful, it's probably a bugfix ;)
2006-02-15Merge ssize_t branch.Martin v. Löwis-9/+13
2006-01-07Fix icc warnings: single bit fields should be unsigned, shadowing local ↵Neal Norwitz-16/+16
variables
2006-01-02Adjust usage of compiler_use_new_block to its return type.Martin v. Löwis-2/+2
2005-12-18fixed compilation with an ordinary C89 compilerFredrik Lundh-2/+1
2005-12-18Fix Armin's bug 1333982. He found it, he didn't created it :-)Neal Norwitz-9/+1
This code generated a C assertion: assert 1, ([s for s in x] + [s for s in x]) pass assert was completely broken, it needed to use the proper block. compiler_use_block() is now no longer used, so remove it.
2005-12-18Handle more error conditions with SystemErrorNeal Norwitz-8/+22
2005-12-18Set MemoryError when alloc failsNeal Norwitz-3/+11
2005-12-17Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,Neal Norwitz-11/+14
simplifies a lot of error handling code, and fixes many memory leaks.
2005-12-06Simplify logic for handling import *Neal Norwitz-6/+3
2005-11-24Fix a few more ref leaks. Backport candidateNeal Norwitz-0/+2