Skip to content

Commit bc67ae2

Browse files
committed
ext/gmp: fix bug16502 test expected error message
1 parent 0339754 commit bc67ae2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ext/gmp/gmp.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,11 @@ static zend_result shift_operator_helper(gmp_binary_ui_op_t op, zval *return_val
372372
goto typeof_op_failure;
373373
}
374374

375-
if (shift > SHRT_MAX && opcode == ZEND_POW) {
375+
if (shift > INT_MAX / 1000) {
376376
zend_throw_error(
377-
zend_ce_value_error, "Exponent must be less than %d",
378-
SHRT_MAX
377+
zend_ce_value_error, "%s must be less than %d",
378+
opcode == ZEND_POW ? "Exponent" : "Shift",
379+
(INT_MAX / 1000)
379380
);
380381
ZVAL_UNDEF(return_value);
381382
return FAILURE;

0 commit comments

Comments
 (0)