Fixed subtraction regression; added new subtraction unit test.

This commit is contained in:
Simon Brooke 2026-02-24 09:08:41 +00:00
parent 62ebaf9819
commit d34d891211
5 changed files with 203 additions and 6 deletions

View file

@ -257,9 +257,9 @@ struct cons_pointer add_integers( struct cons_pointer a,
debug_print_128bit( rv, DEBUG_ARITH );
debug_print( L"\n", DEBUG_ARITH );
if ( carry == 0 && ( rv >= 0 || rv < SMALL_INT_LIMIT ) ) {
if ( carry == 0 && rv >= 0 && rv < SMALL_INT_LIMIT ) {
result =
acquire_integer( ( int64_t ) ( rv & 0xffffffff ), NIL );
acquire_integer( ( int64_t ) ( rv & MAX_INTEGER ), NIL );
break;
} else {
struct cons_pointer new = make_integer( 0, NIL );