Wykres commitów

23 Commity (ede8a0235b47333aaaa8d03a3b9e20b014be3808)

Autor SHA1 Wiadomość Data
Damien George ede8a0235b py/vstr: Raise a RuntimeError if fixed vstr buffer overflows.
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.
2017-09-21 20:29:41 +10:00
Paul Sokolovsky 9dce823cfd py/modbuiltins: Implement abs() by dispatching to MP_UNARY_OP_ABS.
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.
2017-09-18 00:06:43 +03:00
Paul Sokolovsky bfc2092dc5 py/modsys: Initial implementation of sys.getsizeof().
Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and
instances.
2017-08-11 09:43:07 +03:00
Damien George 369e7fd178 tests/unix/extra_coverage: Add test for mp_vprintf with bad fmt spec. 2017-06-30 12:25:42 +10:00
Damien George 74faf4c5fc unix/coverage: Enable scheduler and add tests for it. 2017-03-20 15:20:26 +11:00
Rami Ali 77cbd173df tests: Improve binary.c test coverage. 2017-03-14 18:27:29 +11:00
Rami Ali cba723fc8c tests/io: Improve test coverage of io.BufferedWriter. 2017-01-17 13:27:02 +11:00
Rami Ali 751e379533 tests: Improve frozen import test coverage. 2017-01-16 16:59:03 +11:00
Rami Ali 8d01bd3a1c tests: Improve stream.c test coverage. 2017-01-16 15:57:10 +11:00
Damien George a722ed532f tests/unix/extra_coverage: Add tests for importing frozen packages. 2017-01-08 22:45:55 +11:00
Damien George 8d1c236a1f tests/unix/extra_coverage: Add basic tests to import frozen str and mpy. 2017-01-05 14:58:08 +11:00
Rami Ali d7e168428b tests/unix: Improve formatfloat.c test coverage using C. 2017-01-05 12:31:05 +11:00
Rami Ali ec72db8a39 tests: Improve warning.c test coverage. 2017-01-05 12:23:40 +11:00
Rami Ali 75aa7befec tests/unix: Improve runtime_utils.c test coverage. 2016-12-29 18:24:03 +11:00
Damien George 58f3861358 tests/unix/extra_coverage: Add test for str/bytes with invalid hash. 2016-09-02 15:07:42 +10:00
Delio Brignoli f98bb2ddcb py/mpprint: Fail an assertion with unsupported format specifiers.
Arguments of an unknown type cannot be skipped and continuing to parse a
format string after encountering an unknown format specifier leads to
undefined behaviour.  This patch helps to find use of unsupported formats.
2016-09-01 18:09:44 +10:00
Damien George 9e677114e4 py/mpprint: Fix sign extension when printf'ing %u, %x and %X. 2016-02-01 15:08:42 +00:00
Paul Sokolovsky 54a1d9ecb7 tests/extra_coverage: Update for sys.modules addition. 2015-12-05 00:13:29 +02:00
Damien George a81539db25 tests: Add further tests for mpz code. 2015-10-01 18:49:37 +01:00
Damien George 25afc7da0d tests: Add tests to improve coverage of objstr.c. 2015-09-03 23:06:18 +01:00
Damien George a16715ac62 tests: Add special tests to test mp_printf function to improve coverage. 2015-05-28 14:25:07 +00:00
Damien George f601390ef8 unix: Add some extra coverage tests for vstr and attrtuple. 2015-05-12 23:34:10 +01:00
Damien George d792d9e49e unix: Make extra-coverage function callable from Python scripts.
This allows the output of the extra-coverage tests to be checked using
the normal run-tests script.
2015-05-08 09:18:38 +01:00