View | Details | Raw Unified | Return to bug 227329
Collapse All | Expand All

(-)expr.y (-4 / +2 lines)
Lines 422-432 Link Here
422
void
422
void
423
assert_minus(intmax_t a, intmax_t b, intmax_t r)
423
assert_minus(intmax_t a, intmax_t b, intmax_t r)
424
{
424
{
425
	/* special case subtraction of INTMAX_MIN */
425
	if ((a >= 0 && b < 0 && r <= 0) ||
426
	if (b == INTMAX_MIN && a < 0)
426
	    (a < 0 && b > 0 && r >= 0))
427
		errx(ERR_EXIT, "overflow");
427
		errx(ERR_EXIT, "overflow");
428
	/* check addition of negative subtrahend */
429
	assert_plus(a, -b, r);
430
}
428
}
431
429
432
struct val *
430
struct val *

Return to bug 227329