Skip to content

Commit 663af00

Browse files
committed
Revert "DEBUG replace gmp_zval_binary_ui_op macro"
This reverts commit fd92e7e.
1 parent e5a3011 commit 663af00

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

ext/gmp/gmp.c

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -370,33 +370,7 @@ static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval
370370
{
371371
switch (opcode) {
372372
case ZEND_ADD:
373-
374-
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result;
375-
gmp_temp_t temp_a, temp_b;
376-
377-
FETCH_GMP_ZVAL(gmpnum_a, op1, temp_a, 0);
378-
379-
if (mpz_add_ui && Z_TYPE_P(op2) == IS_LONG && Z_LVAL_P(op2) >= 0) {
380-
gmpnum_b = NULL;
381-
temp_b.is_used = 0;
382-
} else {
383-
FETCH_GMP_ZVAL_DEP(gmpnum_b, op2, temp_b, temp_a, 0);
384-
}
385-
386-
INIT_GMP_RETVAL(gmpnum_result);
387-
388-
if (!gmpnum_b) {
389-
mpz_add_ui(gmpnum_result, gmpnum_a, (gmp_ulong) Z_LVAL_P(op2));
390-
} else {
391-
mpz_add(gmpnum_result, gmpnum_a, gmpnum_b);
392-
}
393-
394-
FREE_GMP_TEMP(temp_a);
395-
FREE_GMP_TEMP(temp_b);
396-
397-
398-
399-
373+
gmp_zval_binary_ui_op(result, op1, op2, mpz_add, mpz_add_ui, false, true);
400374
if (UNEXPECTED(EG(exception))) { return FAILURE; }
401375
return SUCCESS;
402376
case ZEND_SUB:

0 commit comments

Comments
 (0)