Skip to content

Commit 5426c0b

Browse files
committed
zend_string_alloc() should already exit when OOM
1 parent d9f0e36 commit 5426c0b

File tree

5 files changed

+2
-50
lines changed

5 files changed

+2
-50
lines changed

ext/bcmath/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PHP_ARG_ENABLE([bcmath],
55

66
if test "$PHP_BCMATH" != "no"; then
77
PHP_NEW_EXTENSION(bcmath, bcmath.c \
8-
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/sub.c \
8+
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/raisemod.c libbcmath/src/sub.c \
99
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
1010
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
1111
libbcmath/src/rmzero.c libbcmath/src/str2num.c,

ext/bcmath/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
55
if (PHP_BCMATH == "yes") {
66
EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
77
ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
8-
outofmem.c raisemod.c sub.c compare.c divmod.c int2num.c \
8+
raisemod.c sub.c compare.c divmod.c int2num.c \
99
num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \
1010
nearzero.c num2str.c raise.c rmzero.c str2num.c", "bcmath");
1111

ext/bcmath/libbcmath/src/bcmath.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ _PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
150150
int leading_zero));
151151

152152
/* Prototypes needed for external utility routines. */
153-
154-
_PROTOTYPE(void bc_out_of_memory, (void));
155-
156153
#define bc_new_num(length, scale) _bc_new_num_ex((length), (scale), 0)
157154
#define bc_free_num(num) _bc_free_num_ex((num), 0)
158155
#define bc_num2str(num) bc_num2str_ex((num), (num->n_scale))

ext/bcmath/libbcmath/src/num2str.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ zend_string
5555
str = zend_string_alloc(num->n_len + scale + signch + 1, 0);
5656
else
5757
str = zend_string_alloc(num->n_len + signch, 0);
58-
if (str == NULL) bc_out_of_memory();
5958

6059
/* The negative sign if needed. */
6160
sptr = ZSTR_VAL(str);

ext/bcmath/libbcmath/src/outofmem.c

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)