Skip to content

Commit 6f8c6e8

Browse files
committed
Address review comments
1 parent fadd51d commit 6f8c6e8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/gmp/gmp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ static zend_result shift_operator_helper(gmp_binary_ui_op_t op, zval *return_val
359359
mpz_ptr gmpnum_op, gmpnum_result;
360360
gmp_temp_t temp;
361361

362-
/* Inline FETCH_GMP_ZVAL(gmpnum_op, op1, temp, 1); as cannot use RETURN_THROWS() */
362+
/* We do not use FETCH_GMP_ZVAL(...); here as we don't use convert_to_gmp()
363+
* as we want to handle the emitted exception ourself. */
363364
if (UNEXPECTED(!IS_GMP(op1))) {
364365
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
365366
goto typeof_op_failure;
@@ -378,8 +379,7 @@ static zend_result shift_operator_helper(gmp_binary_ui_op_t op, zval *return_val
378379
return SUCCESS;
379380
}
380381

381-
typeof_op_failure:
382-
; /* Blank statement */
382+
typeof_op_failure: ;
383383
/* Returning FAILURE without throwing an exception would emit the
384384
* Unsupported operand types: GMP OP TypeOfOp2
385385
* However, this leads to the engine trying to interpret the GMP object as an integer
@@ -388,13 +388,13 @@ static zend_result shift_operator_helper(gmp_binary_ui_op_t op, zval *return_val
388388
switch (opcode) {
389389
case ZEND_POW:
390390
op_sigil = "**";
391-
break;
391+
break;
392392
case ZEND_SL:
393393
op_sigil = "<<";
394-
break;
394+
break;
395395
case ZEND_SR:
396396
op_sigil = ">>";
397-
break;
397+
break;
398398
EMPTY_SWITCH_DEFAULT_CASE();
399399
}
400400
zend_type_error("Unsupported operand types: %s %s %s", zend_zval_type_name(op1), op_sigil, zend_zval_type_name(op2));

0 commit comments

Comments
 (0)