Skip to content

Commit be072d7

Browse files
committed
Use RETVAL_NEW_STR
The strings are always new, not interned.
1 parent 36f9d18 commit be072d7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ext/bcmath/bcmath.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ PHP_FUNCTION(bcadd)
181181

182182
bc_add (first, second, &result, scale);
183183

184-
RETVAL_STR(bc_num2str_ex(result, scale));
184+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
185185

186186
cleanup: {
187187
bc_free_num(&first);
@@ -230,7 +230,7 @@ PHP_FUNCTION(bcsub)
230230

231231
bc_sub (first, second, &result, scale);
232232

233-
RETVAL_STR(bc_num2str_ex(result, scale));
233+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
234234

235235
cleanup: {
236236
bc_free_num(&first);
@@ -279,7 +279,7 @@ PHP_FUNCTION(bcmul)
279279

280280
bc_multiply (first, second, &result, scale);
281281

282-
RETVAL_STR(bc_num2str_ex(result, scale));
282+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
283283

284284
cleanup: {
285285
bc_free_num(&first);
@@ -331,7 +331,7 @@ PHP_FUNCTION(bcdiv)
331331
goto cleanup;
332332
}
333333

334-
RETVAL_STR(bc_num2str_ex(result, scale));
334+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
335335

336336
cleanup: {
337337
bc_free_num(&first);
@@ -383,7 +383,7 @@ PHP_FUNCTION(bcmod)
383383
goto cleanup;
384384
}
385385

386-
RETVAL_STR(bc_num2str_ex(result, scale));
386+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
387387

388388
cleanup: {
389389
bc_free_num(&first);
@@ -454,7 +454,7 @@ PHP_FUNCTION(bcpowmod)
454454
zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
455455
goto cleanup;
456456
case OK:
457-
RETVAL_STR(bc_num2str_ex(result, scale));
457+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
458458
break;
459459
EMPTY_SWITCH_DEFAULT_CASE();
460460
}
@@ -518,7 +518,7 @@ PHP_FUNCTION(bcpow)
518518

519519
bc_raise(first, exponent, &result, scale);
520520

521-
RETVAL_STR(bc_num2str_ex(result, scale));
521+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
522522

523523
cleanup: {
524524
bc_free_num(&first);
@@ -558,7 +558,7 @@ PHP_FUNCTION(bcsqrt)
558558
}
559559

560560
if (bc_sqrt (&result, scale) != 0) {
561-
RETVAL_STR(bc_num2str_ex(result, scale));
561+
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
562562
} else {
563563
zend_argument_value_error(1, "must be greater than or equal to 0");
564564
}
@@ -631,7 +631,7 @@ static void bcfloor_or_bcceil(INTERNAL_FUNCTION_PARAMETERS, bool is_floor)
631631
}
632632

633633
bc_floor_or_ceil(num, is_floor, &result);
634-
RETVAL_STR(bc_num2str_ex(result, 0));
634+
RETVAL_NEW_STR(bc_num2str_ex(result, 0));
635635

636636
cleanup: {
637637
bc_free_num(&num);
@@ -692,7 +692,7 @@ PHP_FUNCTION(bcround)
692692
}
693693

694694
bc_round(num, precision, mode, &result);
695-
RETVAL_STR(bc_num2str_ex(result, result->n_scale));
695+
RETVAL_NEW_STR(bc_num2str_ex(result, result->n_scale));
696696

697697
cleanup: {
698698
bc_free_num(&num);

0 commit comments

Comments
 (0)