File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -420,25 +420,13 @@ static zend_result shift_operator_helper(gmp_binary_ui_op_t op, zval *return_val
420420 return FAILURE ;
421421 } else {
422422 mpz_ptr gmpnum_op , gmpnum_result ;
423- gmp_temp_t temp ;
424423
425- /* We do not use FETCH_GMP_ZVAL(...); here as we don't use convert_to_gmp()
426- * as we want to handle the emitted exception ourself. */
427- if (UNEXPECTED (!IS_GMP (op1 ))) {
428- if (UNEXPECTED (Z_TYPE_P (op1 ) != IS_LONG )) {
429- goto typeof_op_failure ;
430- }
431- mpz_init (temp .num );
432- mpz_set_si (temp .num , Z_LVAL_P (op1 ));
433- temp .is_used = 1 ;
434- gmpnum_op = temp .num ;
435- } else {
436- gmpnum_op = GET_GMP_FROM_ZVAL (op1 );
437- temp .is_used = 0 ;
424+ if (!gmp_zend_parse_arg_into_mpz_ex (op1 , & gmpnum_op , 1 , true)) {
425+ goto typeof_op_failure ;
438426 }
427+
439428 INIT_GMP_RETVAL (gmpnum_result );
440429 op (gmpnum_result , gmpnum_op , (gmp_ulong ) shift );
441- FREE_GMP_TEMP (temp );
442430 return SUCCESS ;
443431 }
444432
You can’t perform that action at this time.
0 commit comments