Age | Commit message (Collapse) | Author | |
---|---|---|---|
2017-09-21 | py/objexcept: Prevent infinite recursion when allocating exceptions. | Damien George | |
The aim of this patch is to rewrite the functions that create exception instances (mp_obj_exception_make_new and mp_obj_new_exception_msg_varg) so that they do not call any functions that may raise an exception. Otherwise it's possible to create infinite recursion with an exception being raised while trying to create an exception object. The two main things that are done to accomplish this are: 1. Change mp_obj_new_exception_msg_varg to just format the string, then call mp_obj_exception_make_new to actually create the exception object. 2. In mp_obj_exception_make_new and mp_obj_new_exception_msg_varg try to allocate all memory first using functions that don't raise exceptions If any of the memory allocations fail (return NULL) then degrade gracefully by trying other options for memory allocation, eg using the emergency exception buffer. 3. Use a custom printer backend to conservatively format strings: if it can't allocate memory then it just truncates the string. As part of this rewrite, raising an exception without a message, like KeyError(123), will now use the emergency buffer to store the arg and traceback data if there is no heap memory available. Memory use with this patch is unchanged. Code size is increased by: bare-arm: +136 minimal x86: +124 unix x64: +72 unix nanbox: +96 stm32: +88 esp8266: +92 cc3200: +80 | |||
2017-06-10 | tests: Convert remaining "sys.exit()" to "raise SystemExit". | Paul Sokolovsky | |
2017-06-09 | py/objstringio: If created from immutable object, follow copy on write policy. | Paul Sokolovsky | |
Don't create copy of immutable object's contents until .write() is called on BytesIO. | |||
2017-05-06 | tests/micropython: Add test for int.from_bytes with many zero bytes. | Damien George | |
2017-04-22 | tests: Add tests for calling super and loading a method directly. | Damien George | |
2017-04-18 | tests/micropython: Add test for micropython.kbd_intr(). | Damien George | |
2017-04-03 | tests/micropython/heapalloc_iter: Improve skippability. | Paul Sokolovsky | |
2017-03-22 | tests/heapalloc_str: Test no-replacement case for str.replace(). | Paul Sokolovsky | |
2017-03-20 | tests/micropython: Add tests for micropython.schedule(). | Damien George | |
2017-03-14 | tests/micropython/viper_error: Add more tests to improve coverage. | Damien George | |
2017-03-09 | tests/micropython/opt_level: Clarify the expected output for opt_level == 3. | Paul Sokolovsky | |
2017-03-09 | tests/micropython/heapalloc_traceback: Fix backtrace line # after refactor. | Paul Sokolovsky | |
2017-03-09 | tests/micropython: Make uio-using tests skippable. | Paul Sokolovsky | |
2017-03-07 | tests/micropython/: Split off intbig tests. | Paul Sokolovsky | |
2017-02-24 | tests/micropython: Add test for consts that are bignums. | Damien George | |
2017-02-20 | tests/heapalloc_exc_raise.py: Heap alloc test for raising/catching exc. | Paul Sokolovsky | |
2017-02-16 | tests/micropython/heapalloc_iter: Add tests for contains and unpack. | Damien George | |
2017-02-16 | tests/micropython: Add test for iterating with the heap locked. | Damien George | |
2017-02-02 | tests/heapalloc_bytesio: Test for BytesIO with preallocates space. | Paul Sokolovsky | |
2017-01-27 | tests/heapalloc_str: Test for alloc-free string operations. | Paul Sokolovsky | |
Starts with concatenation with an empty string. | |||
2017-01-21 | tests/heapalloc_int_from_bytes: Test that int.from_bytes() can work w/o alloc. | Paul Sokolovsky | |
For a small number of bytes, it's expected to return a small int without allocation. | |||
2017-01-19 | tests/micropython/opt_level: Add test for opt_level 3. | Damien George | |
2016-12-28 | tests/micropython: Add test for micropython.stack_use() function. | Rami Ali | |
2016-12-25 | tests/heapalloc_inst_call: Test for no alloc for simple object calls. | Paul Sokolovsky | |
2016-12-15 | tests/micropython: Get heapalloc_traceback test running on baremetal. | Damien George | |
When printing exceptions from files sent to a target by pyboard.py the filename in the exception is <stdin>, which differs to when running the script on the PC. So we strip out the filename to make the outputs the same on all targets (see also misc/print_exception.py test). | |||
2016-11-21 | tests/micropython: Move alloc-less traceback test to separate test file. | Damien George | |
The native emitter doesn't provide proper traceback info so this test should not be run in that case. | |||
2016-11-21 | tests/micropython: Add test for creating traceback without allocation. | Damien George | |
2016-11-10 | tests/micropython: Add test for import from within viper function. | Damien George | |
2016-10-14 | tests/micropython: Add tests for heap_lock, and emergency exceptions. | Damien George | |
2016-10-11 | tests: Improve test coverage of py/compile.c. | Damien George | |
2016-10-11 | tests/micropython: Add test for micropython.opt_level() function. | Damien George | |
2016-09-27 | py/modmicropython: Add micropython.const, alias for identity function. | Damien George | |
Having a micropython.const identity function, and writing "from micropython import const" at the start of scripts that use the const feature, allows to write scripts which are compatible with CPython, and with uPy builds that don't include const optimisation. This patch adds such a function and updates the tests to do the import. | |||
2016-09-27 | tests/micropython: Add tests for const names being replaced in parser. | Damien George | |
2016-07-01 | tests/meminfo: Update for addition of "max free sz" output. | Paul Sokolovsky | |
2016-06-06 | py/parse: Treat constants that start with underscore as private. | Damien George | |
Assignments of the form "_id = const(value)" are treated as private (following a similar CPython convention) and code is no longer emitted for the assignment to a global variable. See issue #2111. | |||
2016-02-09 | py/viper: Allow casting of Python integers to viper pointers. | Damien George | |
This allows you to pass a number (being an address) to a viper function that expects a pointer, and also allows casting of integers to pointers within viper functions. This was actually the original behaviour, but it regressed due to native type identifiers being promoted to 4 bits in width. | |||
2015-10-13 | tests: Add more tests for viper 16/32-bit load/store, and ellipsis. | Damien George | |
2015-10-13 | py: Implement ptr32 load and store in viper emitter. | Damien George | |
2015-10-08 | py/emitnative: Raise ViperTypeError for unsupported unary ops. | Damien George | |
2015-08-30 | tests: Consolidate all feature check snippets under feature_check/. | Paul Sokolovsky | |
2015-07-23 | py: Allow viper functions to take up to 4 arguments. | Damien George | |
Addresses issue #1380. | |||
2015-06-08 | py: Fallback to stack alloca for Python-stack if heap alloc fails. | Damien George | |
If heap allocation for the Python-stack of a function fails then we may as well allocate the Python-stack on the C stack. This will allow to run more code without using the heap. | |||
2015-06-04 | py: Implement native multiply operation in viper emitter. | Damien George | |
2015-06-04 | py: Implement implicit cast to obj for viper load/store index/value. | Damien George | |
This allows to do "ar[i]" and "ar[i] = val" in viper when ar is a Python object and i and/or val are native viper types (eg ints). Patch also includes tests for this feature. | |||
2015-04-22 | tests: Add more tests for viper, including tests for ViperTypeError's. | Damien George | |
2015-04-16 | py: Add %q format support to mp_[v]printf, and use it. | Damien George | |
2015-04-04 | tests: Add missing tests for builtins, and many other things. | Damien George | |
2015-04-03 | tests: Add specific test for closures in native emitter. | Damien George | |
2015-03-25 | tests: Add tests for SyntaxError, TypeError, and other missing things. | Damien George | |
This is intended to improve coverage of the test suite. | |||
2015-03-12 | tests: Add tests for things that are not already tested. | Damien George | |
The aim here is to improve coverage of the code. |