Insert explicit cut to width when needed
authorPaul Khuong <pvk@pvk.ca>
Thu, 18 Jul 2013 19:03:21 +0000 (15:03 -0400)
committerPaul Khuong <pvk@pvk.ca>
Thu, 18 Jul 2013 19:43:24 +0000 (15:43 -0400)
commitdf2d632ead05d542d3cdd2d8d162060ee586c151
tree37da3e4f808ff4bae1733ffa67894ac7521cc247
parentbe3993e597ead1ffe9def14536d218c5d36511d9
Insert explicit cut to width when needed

 When modular arithmetic operations are replaced with specialised
 modular variants, the result's bitwidth is determined by the variant,
 and might be wider than expected. If necessary, insert an explicit
 cut to the exact bitwidth before returning a value in a non-modular
 context.

 Spotted by pfdietz's random tester.

 Fixes lp#1199428.
NEWS
src/compiler/srctran.lisp
tests/compiler.pure.lisp