summaryrefslogtreecommitdiffstatshomepage
path: root/py/lexerunix.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-05-09 17:21:42 +0100
committerDamien George <damien.p.george@gmail.com>2016-05-09 17:21:42 +0100
commit460b0863334fb143667ae6aa1b5f0bd2bbdf8282 (patch)
treeb3acfba38057f2e218deaa9d84b60fda518c98d3 /py/lexerunix.c
parentde5e0ed2e080502cfcccdda541dbb44e0d51dfe2 (diff)
downloadmicropython-460b0863334fb143667ae6aa1b5f0bd2bbdf8282.tar.gz
micropython-460b0863334fb143667ae6aa1b5f0bd2bbdf8282.zip
py/mpz: Fix mpn_div so that it doesn't modify memory of denominator.
Previous to this patch bignum division and modulo would temporarily modify the RHS argument to the operation (eg x/y would modify y), but on return the RHS would be restored to its original value. This is not allowed because arguments to binary operations are const, and in particular might live in ROM. The modification was to normalise the arg (and then unnormalise before returning), and this patch makes it so the normalisation is done on the fly and the arg is now accessed as read-only. This change doesn't increase the order complexity of the operation, and actually reduces code size.
Diffstat (limited to 'py/lexerunix.c')
0 files changed, 0 insertions, 0 deletions