- Sep 22, 2017
-
-
Damien George authored
For consistency with all the other exception messages.
-
Damien George authored
-
Damien George authored
-
- Sep 21, 2017
-
-
Damien George authored
This is the final piece of USB device refactoring to support multiple USB device instances.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
Current users of fixed vstr buffers (building file paths) assume that there is no overflow and do not check for overflow after building the vstr. This has the potential to lead to NULL pointer dereferences (when vstr_null_terminated_str returns NULL because it can't allocate RAM for the terminating byte) and stat'ing and loading invalid path names (due to the path being truncated). The safest and simplest thing to do in these cases is just raise an exception if a write goes beyond the end of a fixed vstr buffer, which is what this patch does. It also simplifies the vstr code.
-
Damien George authored
The vstr argument to the calls to vstr_add_len are dynamically allocated (ie fixed_buf=false) and so vstr_add_len will never return NULL. So there's no need to check for it. Any out-of-memory errors are raised by the call to m_renew in vstr_ensure_extra.
-
Damien George authored
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
-
- Sep 20, 2017
-
-
Damien George authored
It's written straight away in the function on every call so it doesn't need to be static.
-
Damien George authored
-
- Sep 19, 2017
-
-
Paul Sokolovsky authored
An issue was due to incorrectly taking size of default strip characters set.
-
- Sep 18, 2017
-
-
Damien George authored
-
Damien George authored
-
- Sep 17, 2017
-
-
Paul Sokolovsky authored
This allows user classes to implement __abs__ special method, and saves code size (104 bytes for x86_64), even though during refactor, an issue was fixed and few optimizations were made: * abs() of minimum (negative) small int value is calculated properly. * objint_longlong and objint_mpz avoid allocating new object is the argument is already non-negative.
-
Paul Sokolovsky authored
-
- Sep 16, 2017
-
-
Paul Sokolovsky authored
MicroPython doesn't maintain local symbolic environment, so any feature depending on it won't work as expected.
-
- Sep 13, 2017
-
-
Damien George authored
-
Damien George authored
Variable arguments in a macro should take at least 1 argument.
-
Damien George authored
-
Peter Hinch authored
-
Damien George authored
Prior to this patch calling pyb.Timer(id) would always create a new timer instance, even if there was an existing one. This patch fixes this behaviour to match other peripherals, like UART, such that constructing a timer with just the id will retrieve any existing instances. The patch also refactors the way timers are validated on construction to simplify and reduce code size.
-
- Sep 12, 2017
-
-
Damien George authored
As a pointer (const char *) it takes up an extra word of storage which is in RAM.
-
Damien George authored
This patch also removes the empty type "pinbase_type" (which crashes if accessed) and uses "machine_pinbase_type" instead as the type of the PinBase singleton.
-
ASM authored
Tested using Clang on self-hosted Termux environment https://termux.com/.
-
Damien George authored
-
- Sep 10, 2017
-
-
Paul Sokolovsky authored
Given that various ports now require submodules, rewrite the section to be more generic. Also, add git submodule update command to other sections for easy user start.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Don't assume that MICROPY_PY_ALL_SPECIAL_METHODS is defined, as required for inplace special methods. Fixes Zephyr tests.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
This test should be run only if support for reverse ops is enabled, so the corresponding feature_check is added to run-tests.
-
Paul Sokolovsky authored
If, for class X, X.__add__(Y) doesn't exist (or returns NotImplemented), try Y.__radd__(X) instead. This patch could be simpler, but requires undoing operand swap and operation switch to get non-confusing error message in case __radd__ doesn't exist.
-
Damien George authored
So that the latest urllib3 is retrieved, which has improved SSL security. This fixes the temporary path from f578947a
-
Paul Sokolovsky authored
Defaults of 4096 and 5 respectively are too high to esp8266, causing out of memory with a database beyond couple of pages.
-
Paul Sokolovsky authored
-