Coverage Report

Created: 2025-07-23 06:33

/src/php-src/Zend/zend_multiply.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
   +----------------------------------------------------------------------+
3
   | Zend Engine                                                          |
4
   +----------------------------------------------------------------------+
5
   | Copyright (c) Zend Technologies Ltd. (http://www.zend.com)           |
6
   +----------------------------------------------------------------------+
7
   | This source file is subject to version 2.00 of the Zend license,     |
8
   | that is bundled with this package in the file LICENSE, and is        |
9
   | available through the world-wide-web at the following url:           |
10
   | http://www.zend.com/license/2_00.txt.                                |
11
   | If you did not receive a copy of the Zend license and are unable to  |
12
   | obtain it through the world-wide-web, please send a note to          |
13
   | license@zend.com so we can mail you a copy immediately.              |
14
   +----------------------------------------------------------------------+
15
   | Authors: Sascha Schumann <sascha@schumann.cx>                        |
16
   |          Ard Biesheuvel <ard.biesheuvel@linaro.org>                  |
17
   +----------------------------------------------------------------------+
18
*/
19
20
#include "zend_portability.h"
21
22
#ifndef ZEND_MULTIPLY_H
23
#define ZEND_MULTIPLY_H
24
25
#if defined(PHP_HAVE_BUILTIN_SMULL_OVERFLOW) && SIZEOF_LONG == SIZEOF_ZEND_LONG
26
27
146k
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
28
146k
  long __tmpvar;                          \
29
146k
  if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \
30
25.9k
    (dval) = (double) (a) * (double) (b);           \
31
25.9k
  }                                \
32
146k
  else (lval) = __tmpvar;                     \
33
146k
} while (0)
34
35
#elif defined(PHP_HAVE_BUILTIN_SMULLL_OVERFLOW) && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
36
37
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
38
  long long __tmpvar;                       \
39
  if (((usedval) = __builtin_smulll_overflow((a), (b), &__tmpvar))) { \
40
    (dval) = (double) (a) * (double) (b);           \
41
  }                               \
42
  else (lval) = __tmpvar;                     \
43
} while (0)
44
45
#elif (defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
46
47
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
48
  zend_long __tmpvar;                           \
49
  __asm__ ("imul %3,%0\n"                     \
50
    "adc $0,%1"                         \
51
      : "=r"(__tmpvar),"=r"(usedval)              \
52
      : "0"(a), "r"(b), "1"(0));                \
53
  if (usedval) (dval) = (double) (a) * (double) (b);        \
54
  else (lval) = __tmpvar;                     \
55
} while (0)
56
57
#elif defined(__arm__) && defined(__GNUC__)
58
59
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
60
  zend_long __tmpvar;                           \
61
  __asm__("smull %0, %1, %2, %3\n"                \
62
    "sub %1, %1, %0, asr #31"                 \
63
      : "=r"(__tmpvar), "=r"(usedval)             \
64
      : "r"(a), "r"(b));                    \
65
  if (usedval) (dval) = (double) (a) * (double) (b);        \
66
  else (lval) = __tmpvar;                     \
67
} while (0)
68
69
#elif defined(__aarch64__) && defined(__GNUC__)
70
71
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
72
  zend_long __tmpvar;                           \
73
  __asm__("mul %0, %2, %3\n"                    \
74
    "smulh %1, %2, %3\n"                    \
75
    "sub %1, %1, %0, asr #63\n"                 \
76
      : "=&r"(__tmpvar), "=&r"(usedval)           \
77
      : "r"(a), "r"(b));                    \
78
  if (usedval) (dval) = (double) (a) * (double) (b);        \
79
  else (lval) = __tmpvar;                     \
80
} while (0)
81
82
#elif defined(ZEND_WIN32) && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
83
84
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
85
  long long __tmpvar;                       \
86
  if (((usedval) = FAILED(LongLongMult((a), (b), &__tmpvar)))) {  \
87
    (dval) = (double) (a) * (double) (b);           \
88
  }                               \
89
  else (lval) = __tmpvar;                     \
90
} while (0)
91
92
#elif defined(ZEND_WIN32) && SIZEOF_LONG == SIZEOF_ZEND_LONG
93
94
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
95
  long __tmpvar;                          \
96
  if (((usedval) = FAILED(LongMult((a), (b), &__tmpvar)))) {    \
97
    (dval) = (double) (a) * (double) (b);           \
98
  }                               \
99
  else (lval) = __tmpvar;                     \
100
} while (0)
101
102
#elif defined(__powerpc64__) && defined(__GNUC__)
103
104
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
105
  long __low, __high;           \
106
  __asm__("mulld %0,%2,%3\n\t"          \
107
    "mulhd %1,%2,%3\n"          \
108
    : "=&r"(__low), "=&r"(__high)       \
109
    : "r"(a), "r"(b));          \
110
  if ((__low >> 63) != __high) {          \
111
    (dval) = (double) (a) * (double) (b);     \
112
    (usedval) = 1;            \
113
  } else {              \
114
    (lval) = __low;           \
115
    (usedval) = 0;            \
116
  }               \
117
} while (0)
118
119
#elif SIZEOF_ZEND_LONG == 4
120
121
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
122
  int64_t __result = (int64_t) (a) * (int64_t) (b);       \
123
  if (__result > ZEND_LONG_MAX || __result < ZEND_LONG_MIN) {   \
124
    (dval) = (double) __result;                 \
125
    (usedval) = 1;                        \
126
  } else {                            \
127
    (lval) = (long) __result;                 \
128
    (usedval) = 0;                        \
129
  }                               \
130
} while (0)
131
132
#else
133
134
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
135
  long   __lres  = (a) * (b);                   \
136
  long double __dres  = (long double)(a) * (long double)(b);    \
137
  long double __delta = (long double) __lres - __dres;      \
138
  if ( ((usedval) = (( __dres + __delta ) != __dres))) {      \
139
    (dval) = __dres;                      \
140
  } else {                            \
141
    (lval) = __lres;                      \
142
  }                               \
143
} while (0)
144
145
#endif
146
147
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
148
149
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
150
{
151
  size_t res = nmemb;
152
  size_t m_overflow = 0;
153
154
  if (ZEND_CONST_COND(offset == 0, 0)) {
155
    __asm__ ("mull %3\n\tadcl $0,%1"
156
       : "=&a"(res), "=&d" (m_overflow)
157
       : "%0"(res),
158
         "rm"(size)
159
       : "cc");
160
  } else {
161
    __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
162
       : "=&a"(res), "=&d" (m_overflow)
163
       : "%0"(res),
164
         "rm"(size),
165
         "rm"(offset)
166
       : "cc");
167
  }
168
169
  if (UNEXPECTED(m_overflow)) {
170
    *overflow = 1;
171
    return 0;
172
  }
173
  *overflow = 0;
174
  return res;
175
}
176
177
#elif defined(__GNUC__) && defined(__x86_64__)
178
179
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
180
363M
{
181
363M
  size_t res;
182
363M
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
363M
# define LP_SUFF "q"
188
363M
#endif
189
190
363M
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
360M
    res = nmemb;
192
360M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
360M
      "adc $0,%1"
194
360M
      : "=&a"(res), "=&d" (m_overflow)
195
360M
      : "%0"(res),
196
360M
        "rm"(size)
197
360M
      : "cc");
198
360M
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
184
    res = size;
200
184
    __asm__ ("add %2, %0\n\t"
201
184
      "adc $0,%1"
202
184
      : "+r"(res), "+r" (m_overflow)
203
184
      : "rm"(offset)
204
184
      : "cc");
205
3.04M
  } else {
206
3.04M
    res = nmemb;
207
3.04M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
3.04M
      "add %4,%0\n\t"
209
3.04M
      "adc $0,%1"
210
3.04M
      : "=&a"(res), "=&d" (m_overflow)
211
3.04M
      : "%0"(res),
212
3.04M
        "rm"(size),
213
3.04M
        "rm"(offset)
214
3.04M
      : "cc");
215
3.04M
  }
216
363M
#undef LP_SUFF
217
363M
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
363M
  *overflow = 0;
222
363M
  return res;
223
363M
}
Unexecuted instantiation: php_date.c:zend_safe_address
Unexecuted instantiation: astro.c:zend_safe_address
Unexecuted instantiation: dow.c:zend_safe_address
Unexecuted instantiation: parse_date.c:zend_safe_address
Unexecuted instantiation: parse_tz.c:zend_safe_address
Unexecuted instantiation: parse_posix.c:zend_safe_address
Unexecuted instantiation: timelib.c:zend_safe_address
Unexecuted instantiation: tm2unixtime.c:zend_safe_address
Unexecuted instantiation: unixtime2tm.c:zend_safe_address
Unexecuted instantiation: parse_iso_intervals.c:zend_safe_address
Unexecuted instantiation: interval.c:zend_safe_address
php_pcre.c:zend_safe_address
Line
Count
Source
180
797
{
181
797
  size_t res;
182
797
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
797
# define LP_SUFF "q"
188
797
#endif
189
190
797
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
0
    res = nmemb;
192
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
0
      "adc $0,%1"
194
0
      : "=&a"(res), "=&d" (m_overflow)
195
0
      : "%0"(res),
196
0
        "rm"(size)
197
0
      : "cc");
198
797
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
184
    res = size;
200
184
    __asm__ ("add %2, %0\n\t"
201
184
      "adc $0,%1"
202
184
      : "+r"(res), "+r" (m_overflow)
203
184
      : "rm"(offset)
204
184
      : "cc");
205
613
  } else {
206
613
    res = nmemb;
207
613
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
613
      "add %4,%0\n\t"
209
613
      "adc $0,%1"
210
613
      : "=&a"(res), "=&d" (m_overflow)
211
613
      : "%0"(res),
212
613
        "rm"(size),
213
613
        "rm"(offset)
214
613
      : "cc");
215
613
  }
216
797
#undef LP_SUFF
217
797
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
797
  *overflow = 0;
222
797
  return res;
223
797
}
Unexecuted instantiation: exif.c:zend_safe_address
Unexecuted instantiation: hash_adler32.c:zend_safe_address
Unexecuted instantiation: hash_crc32.c:zend_safe_address
Unexecuted instantiation: hash_fnv.c:zend_safe_address
Unexecuted instantiation: hash_gost.c:zend_safe_address
Unexecuted instantiation: hash_haval.c:zend_safe_address
Unexecuted instantiation: hash_joaat.c:zend_safe_address
Unexecuted instantiation: hash_md.c:zend_safe_address
Unexecuted instantiation: hash_murmur.c:zend_safe_address
Unexecuted instantiation: hash_ripemd.c:zend_safe_address
Unexecuted instantiation: hash_sha_ni.c:zend_safe_address
Unexecuted instantiation: hash_sha_sse2.c:zend_safe_address
Unexecuted instantiation: hash_sha.c:zend_safe_address
Unexecuted instantiation: hash_sha3.c:zend_safe_address
Unexecuted instantiation: hash_snefru.c:zend_safe_address
Unexecuted instantiation: hash_tiger.c:zend_safe_address
Unexecuted instantiation: hash_whirlpool.c:zend_safe_address
Unexecuted instantiation: hash_xxhash.c:zend_safe_address
Unexecuted instantiation: hash.c:zend_safe_address
Unexecuted instantiation: json_encoder.c:zend_safe_address
Unexecuted instantiation: json_parser.tab.c:zend_safe_address
Unexecuted instantiation: json_scanner.c:zend_safe_address
Unexecuted instantiation: json.c:zend_safe_address
Unexecuted instantiation: php_lexbor.c:zend_safe_address
Unexecuted instantiation: csprng.c:zend_safe_address
Unexecuted instantiation: engine_mt19937.c:zend_safe_address
Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:zend_safe_address
Unexecuted instantiation: engine_secure.c:zend_safe_address
Unexecuted instantiation: engine_user.c:zend_safe_address
Unexecuted instantiation: engine_xoshiro256starstar.c:zend_safe_address
Unexecuted instantiation: gammasection.c:zend_safe_address
Unexecuted instantiation: random.c:zend_safe_address
Unexecuted instantiation: randomizer.c:zend_safe_address
Unexecuted instantiation: zend_utils.c:zend_safe_address
Unexecuted instantiation: php_reflection.c:zend_safe_address
Unexecuted instantiation: php_spl.c:zend_safe_address
Unexecuted instantiation: spl_array.c:zend_safe_address
Unexecuted instantiation: spl_directory.c:zend_safe_address
Unexecuted instantiation: spl_dllist.c:zend_safe_address
Unexecuted instantiation: spl_exceptions.c:zend_safe_address
Unexecuted instantiation: spl_fixedarray.c:zend_safe_address
Unexecuted instantiation: spl_functions.c:zend_safe_address
Unexecuted instantiation: spl_heap.c:zend_safe_address
Unexecuted instantiation: spl_iterators.c:zend_safe_address
Unexecuted instantiation: spl_observer.c:zend_safe_address
Unexecuted instantiation: array.c:zend_safe_address
Unexecuted instantiation: assert.c:zend_safe_address
Unexecuted instantiation: base64.c:zend_safe_address
Unexecuted instantiation: basic_functions.c:zend_safe_address
Unexecuted instantiation: browscap.c:zend_safe_address
Unexecuted instantiation: crc32_x86.c:zend_safe_address
Unexecuted instantiation: crc32.c:zend_safe_address
Unexecuted instantiation: credits.c:zend_safe_address
Unexecuted instantiation: crypt.c:zend_safe_address
Unexecuted instantiation: css.c:zend_safe_address
Unexecuted instantiation: datetime.c:zend_safe_address
Unexecuted instantiation: dir.c:zend_safe_address
Unexecuted instantiation: dl.c:zend_safe_address
Unexecuted instantiation: dns.c:zend_safe_address
Unexecuted instantiation: exec.c:zend_safe_address
Unexecuted instantiation: file.c:zend_safe_address
Unexecuted instantiation: filestat.c:zend_safe_address
Unexecuted instantiation: filters.c:zend_safe_address
Unexecuted instantiation: flock_compat.c:zend_safe_address
Unexecuted instantiation: formatted_print.c:zend_safe_address
Unexecuted instantiation: fsock.c:zend_safe_address
Unexecuted instantiation: ftok.c:zend_safe_address
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_safe_address
Unexecuted instantiation: head.c:zend_safe_address
Unexecuted instantiation: hrtime.c:zend_safe_address
html.c:zend_safe_address
Line
Count
Source
180
1.37k
{
181
1.37k
  size_t res;
182
1.37k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
1.37k
# define LP_SUFF "q"
188
1.37k
#endif
189
190
1.37k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
1.37k
    res = nmemb;
192
1.37k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
1.37k
      "adc $0,%1"
194
1.37k
      : "=&a"(res), "=&d" (m_overflow)
195
1.37k
      : "%0"(res),
196
1.37k
        "rm"(size)
197
1.37k
      : "cc");
198
1.37k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
1.37k
#undef LP_SUFF
217
1.37k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
1.37k
  *overflow = 0;
222
1.37k
  return res;
223
1.37k
}
Unexecuted instantiation: http_fopen_wrapper.c:zend_safe_address
Unexecuted instantiation: http.c:zend_safe_address
Unexecuted instantiation: image.c:zend_safe_address
Unexecuted instantiation: incomplete_class.c:zend_safe_address
Unexecuted instantiation: info.c:zend_safe_address
Unexecuted instantiation: iptc.c:zend_safe_address
Unexecuted instantiation: levenshtein.c:zend_safe_address
Unexecuted instantiation: link.c:zend_safe_address
Unexecuted instantiation: mail.c:zend_safe_address
Unexecuted instantiation: math.c:zend_safe_address
Unexecuted instantiation: md5.c:zend_safe_address
Unexecuted instantiation: metaphone.c:zend_safe_address
Unexecuted instantiation: microtime.c:zend_safe_address
Unexecuted instantiation: net.c:zend_safe_address
Unexecuted instantiation: pack.c:zend_safe_address
Unexecuted instantiation: pageinfo.c:zend_safe_address
Unexecuted instantiation: password.c:zend_safe_address
Unexecuted instantiation: php_fopen_wrapper.c:zend_safe_address
Unexecuted instantiation: proc_open.c:zend_safe_address
Unexecuted instantiation: quot_print.c:zend_safe_address
Unexecuted instantiation: scanf.c:zend_safe_address
Unexecuted instantiation: sha1.c:zend_safe_address
Unexecuted instantiation: soundex.c:zend_safe_address
Unexecuted instantiation: streamsfuncs.c:zend_safe_address
Unexecuted instantiation: string.c:zend_safe_address
Unexecuted instantiation: strnatcmp.c:zend_safe_address
Unexecuted instantiation: syslog.c:zend_safe_address
Unexecuted instantiation: type.c:zend_safe_address
Unexecuted instantiation: uniqid.c:zend_safe_address
Unexecuted instantiation: url_scanner_ex.c:zend_safe_address
Unexecuted instantiation: url.c:zend_safe_address
Unexecuted instantiation: user_filters.c:zend_safe_address
Unexecuted instantiation: uuencode.c:zend_safe_address
Unexecuted instantiation: var_unserializer.c:zend_safe_address
Unexecuted instantiation: var.c:zend_safe_address
Unexecuted instantiation: versioning.c:zend_safe_address
Unexecuted instantiation: crypt_sha256.c:zend_safe_address
Unexecuted instantiation: crypt_sha512.c:zend_safe_address
Unexecuted instantiation: php_crypt_r.c:zend_safe_address
Unexecuted instantiation: php_uri.c:zend_safe_address
Unexecuted instantiation: php_uri_common.c:zend_safe_address
Unexecuted instantiation: php_uriparser.c:zend_safe_address
Unexecuted instantiation: explicit_bzero.c:zend_safe_address
Unexecuted instantiation: fopen_wrappers.c:zend_safe_address
Unexecuted instantiation: getopt.c:zend_safe_address
Unexecuted instantiation: main.c:zend_safe_address
Unexecuted instantiation: network.c:zend_safe_address
Unexecuted instantiation: output.c:zend_safe_address
Unexecuted instantiation: php_content_types.c:zend_safe_address
Unexecuted instantiation: php_ini_builder.c:zend_safe_address
Unexecuted instantiation: php_ini.c:zend_safe_address
Unexecuted instantiation: php_glob.c:zend_safe_address
Unexecuted instantiation: php_odbc_utils.c:zend_safe_address
Unexecuted instantiation: php_open_temporary_file.c:zend_safe_address
Unexecuted instantiation: php_scandir.c:zend_safe_address
Unexecuted instantiation: php_syslog.c:zend_safe_address
Unexecuted instantiation: php_ticks.c:zend_safe_address
Unexecuted instantiation: php_variables.c:zend_safe_address
Unexecuted instantiation: reentrancy.c:zend_safe_address
Unexecuted instantiation: rfc1867.c:zend_safe_address
Unexecuted instantiation: safe_bcmp.c:zend_safe_address
Unexecuted instantiation: SAPI.c:zend_safe_address
Unexecuted instantiation: snprintf.c:zend_safe_address
Unexecuted instantiation: spprintf.c:zend_safe_address
Unexecuted instantiation: strlcat.c:zend_safe_address
Unexecuted instantiation: strlcpy.c:zend_safe_address
Unexecuted instantiation: cast.c:zend_safe_address
Unexecuted instantiation: filter.c:zend_safe_address
Unexecuted instantiation: glob_wrapper.c:zend_safe_address
Unexecuted instantiation: memory.c:zend_safe_address
Unexecuted instantiation: mmap.c:zend_safe_address
Unexecuted instantiation: plain_wrapper.c:zend_safe_address
Unexecuted instantiation: streams.c:zend_safe_address
Unexecuted instantiation: transports.c:zend_safe_address
Unexecuted instantiation: userspace.c:zend_safe_address
Unexecuted instantiation: xp_socket.c:zend_safe_address
block_pass.c:zend_safe_address
Line
Count
Source
180
111k
{
181
111k
  size_t res;
182
111k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
111k
# define LP_SUFF "q"
188
111k
#endif
189
190
111k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
111k
    res = nmemb;
192
111k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
111k
      "adc $0,%1"
194
111k
      : "=&a"(res), "=&d" (m_overflow)
195
111k
      : "%0"(res),
196
111k
        "rm"(size)
197
111k
      : "cc");
198
111k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
111k
#undef LP_SUFF
217
111k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
111k
  *overflow = 0;
222
111k
  return res;
223
111k
}
compact_literals.c:zend_safe_address
Line
Count
Source
180
111k
{
181
111k
  size_t res;
182
111k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
111k
# define LP_SUFF "q"
188
111k
#endif
189
190
111k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
111k
    res = nmemb;
192
111k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
111k
      "adc $0,%1"
194
111k
      : "=&a"(res), "=&d" (m_overflow)
195
111k
      : "%0"(res),
196
111k
        "rm"(size)
197
111k
      : "cc");
198
111k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
111k
#undef LP_SUFF
217
111k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
111k
  *overflow = 0;
222
111k
  return res;
223
111k
}
Unexecuted instantiation: compact_vars.c:zend_safe_address
dce.c:zend_safe_address
Line
Count
Source
180
314k
{
181
314k
  size_t res;
182
314k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
314k
# define LP_SUFF "q"
188
314k
#endif
189
190
314k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
314k
    res = nmemb;
192
314k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
314k
      "adc $0,%1"
194
314k
      : "=&a"(res), "=&d" (m_overflow)
195
314k
      : "%0"(res),
196
314k
        "rm"(size)
197
314k
      : "cc");
198
314k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
314k
#undef LP_SUFF
217
314k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
314k
  *overflow = 0;
222
314k
  return res;
223
314k
}
Unexecuted instantiation: dfa_pass.c:zend_safe_address
Unexecuted instantiation: escape_analysis.c:zend_safe_address
Unexecuted instantiation: nop_removal.c:zend_safe_address
optimize_func_calls.c:zend_safe_address
Line
Count
Source
180
108k
{
181
108k
  size_t res;
182
108k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
108k
# define LP_SUFF "q"
188
108k
#endif
189
190
108k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
108k
    res = nmemb;
192
108k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
108k
      "adc $0,%1"
194
108k
      : "=&a"(res), "=&d" (m_overflow)
195
108k
      : "%0"(res),
196
108k
        "rm"(size)
197
108k
      : "cc");
198
108k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
108k
#undef LP_SUFF
217
108k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
108k
  *overflow = 0;
222
108k
  return res;
223
108k
}
Unexecuted instantiation: optimize_temp_vars_5.c:zend_safe_address
Unexecuted instantiation: pass1.c:zend_safe_address
Unexecuted instantiation: pass3.c:zend_safe_address
Unexecuted instantiation: sccp.c:zend_safe_address
scdf.c:zend_safe_address
Line
Count
Source
180
78.5k
{
181
78.5k
  size_t res;
182
78.5k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
78.5k
# define LP_SUFF "q"
188
78.5k
#endif
189
190
78.5k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
78.5k
    res = nmemb;
192
78.5k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
78.5k
      "adc $0,%1"
194
78.5k
      : "=&a"(res), "=&d" (m_overflow)
195
78.5k
      : "%0"(res),
196
78.5k
        "rm"(size)
197
78.5k
      : "cc");
198
78.5k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
78.5k
#undef LP_SUFF
217
78.5k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
78.5k
  *overflow = 0;
222
78.5k
  return res;
223
78.5k
}
zend_call_graph.c:zend_safe_address
Line
Count
Source
180
297k
{
181
297k
  size_t res;
182
297k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
297k
# define LP_SUFF "q"
188
297k
#endif
189
190
297k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
297k
    res = nmemb;
192
297k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
297k
      "adc $0,%1"
194
297k
      : "=&a"(res), "=&d" (m_overflow)
195
297k
      : "%0"(res),
196
297k
        "rm"(size)
197
297k
      : "cc");
198
297k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
297k
#undef LP_SUFF
217
297k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
297k
  *overflow = 0;
222
297k
  return res;
223
297k
}
zend_cfg.c:zend_safe_address
Line
Count
Source
180
465k
{
181
465k
  size_t res;
182
465k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
465k
# define LP_SUFF "q"
188
465k
#endif
189
190
465k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
465k
    res = nmemb;
192
465k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
465k
      "adc $0,%1"
194
465k
      : "=&a"(res), "=&d" (m_overflow)
195
465k
      : "%0"(res),
196
465k
        "rm"(size)
197
465k
      : "cc");
198
465k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
465k
#undef LP_SUFF
217
465k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
465k
  *overflow = 0;
222
465k
  return res;
223
465k
}
Unexecuted instantiation: zend_dfg.c:zend_safe_address
Unexecuted instantiation: zend_dump.c:zend_safe_address
Unexecuted instantiation: zend_func_info.c:zend_safe_address
zend_inference.c:zend_safe_address
Line
Count
Source
180
78.5k
{
181
78.5k
  size_t res;
182
78.5k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
78.5k
# define LP_SUFF "q"
188
78.5k
#endif
189
190
78.5k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
78.5k
    res = nmemb;
192
78.5k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
78.5k
      "adc $0,%1"
194
78.5k
      : "=&a"(res), "=&d" (m_overflow)
195
78.5k
      : "%0"(res),
196
78.5k
        "rm"(size)
197
78.5k
      : "cc");
198
78.5k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
78.5k
#undef LP_SUFF
217
78.5k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
78.5k
  *overflow = 0;
222
78.5k
  return res;
223
78.5k
}
Unexecuted instantiation: zend_optimizer.c:zend_safe_address
zend_ssa.c:zend_safe_address
Line
Count
Source
180
400k
{
181
400k
  size_t res;
182
400k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
400k
# define LP_SUFF "q"
188
400k
#endif
189
190
400k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
400k
    res = nmemb;
192
400k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
400k
      "adc $0,%1"
194
400k
      : "=&a"(res), "=&d" (m_overflow)
195
400k
      : "%0"(res),
196
400k
        "rm"(size)
197
400k
      : "cc");
198
400k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
400k
#undef LP_SUFF
217
400k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
400k
  *overflow = 0;
222
400k
  return res;
223
400k
}
zend_alloc.c:zend_safe_address
Line
Count
Source
180
361M
{
181
361M
  size_t res;
182
361M
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
361M
# define LP_SUFF "q"
188
361M
#endif
189
190
361M
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
358M
    res = nmemb;
192
358M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
358M
      "adc $0,%1"
194
358M
      : "=&a"(res), "=&d" (m_overflow)
195
358M
      : "%0"(res),
196
358M
        "rm"(size)
197
358M
      : "cc");
198
358M
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
3.04M
  } else {
206
3.04M
    res = nmemb;
207
3.04M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
3.04M
      "add %4,%0\n\t"
209
3.04M
      "adc $0,%1"
210
3.04M
      : "=&a"(res), "=&d" (m_overflow)
211
3.04M
      : "%0"(res),
212
3.04M
        "rm"(size),
213
3.04M
        "rm"(offset)
214
3.04M
      : "cc");
215
3.04M
  }
216
361M
#undef LP_SUFF
217
361M
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
361M
  *overflow = 0;
222
361M
  return res;
223
361M
}
Unexecuted instantiation: zend_API.c:zend_safe_address
Unexecuted instantiation: zend_ast.c:zend_safe_address
Unexecuted instantiation: zend_attributes.c:zend_safe_address
Unexecuted instantiation: zend_builtin_functions.c:zend_safe_address
Unexecuted instantiation: zend_call_stack.c:zend_safe_address
Unexecuted instantiation: zend_closures.c:zend_safe_address
Unexecuted instantiation: zend_compile.c:zend_safe_address
Unexecuted instantiation: zend_constants.c:zend_safe_address
Unexecuted instantiation: zend_cpuinfo.c:zend_safe_address
Unexecuted instantiation: zend_default_classes.c:zend_safe_address
Unexecuted instantiation: zend_dtrace.c:zend_safe_address
zend_enum.c:zend_safe_address
Line
Count
Source
180
4.55k
{
181
4.55k
  size_t res;
182
4.55k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
4.55k
# define LP_SUFF "q"
188
4.55k
#endif
189
190
4.55k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
4.55k
    res = nmemb;
192
4.55k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
4.55k
      "adc $0,%1"
194
4.55k
      : "=&a"(res), "=&d" (m_overflow)
195
4.55k
      : "%0"(res),
196
4.55k
        "rm"(size)
197
4.55k
      : "cc");
198
4.55k
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
0
    res = size;
200
0
    __asm__ ("add %2, %0\n\t"
201
0
      "adc $0,%1"
202
0
      : "+r"(res), "+r" (m_overflow)
203
0
      : "rm"(offset)
204
0
      : "cc");
205
0
  } else {
206
0
    res = nmemb;
207
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
0
      "add %4,%0\n\t"
209
0
      "adc $0,%1"
210
0
      : "=&a"(res), "=&d" (m_overflow)
211
0
      : "%0"(res),
212
0
        "rm"(size),
213
0
        "rm"(offset)
214
0
      : "cc");
215
0
  }
216
4.55k
#undef LP_SUFF
217
4.55k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
4.55k
  *overflow = 0;
222
4.55k
  return res;
223
4.55k
}
Unexecuted instantiation: zend_exceptions.c:zend_safe_address
Unexecuted instantiation: zend_execute_API.c:zend_safe_address
Unexecuted instantiation: zend_execute.c:zend_safe_address
Unexecuted instantiation: zend_extensions.c:zend_safe_address
Unexecuted instantiation: zend_fibers.c:zend_safe_address
Unexecuted instantiation: zend_float.c:zend_safe_address
Unexecuted instantiation: zend_gc.c:zend_safe_address
Unexecuted instantiation: zend_gdb.c:zend_safe_address
Unexecuted instantiation: zend_generators.c:zend_safe_address
Unexecuted instantiation: zend_hash.c:zend_safe_address
Unexecuted instantiation: zend_highlight.c:zend_safe_address
Unexecuted instantiation: zend_hrtime.c:zend_safe_address
Unexecuted instantiation: zend_inheritance.c:zend_safe_address
Unexecuted instantiation: zend_ini_parser.c:zend_safe_address
Unexecuted instantiation: zend_ini_scanner.c:zend_safe_address
Unexecuted instantiation: zend_ini.c:zend_safe_address
Unexecuted instantiation: zend_interfaces.c:zend_safe_address
Unexecuted instantiation: zend_iterators.c:zend_safe_address
Unexecuted instantiation: zend_language_parser.c:zend_safe_address
Unexecuted instantiation: zend_language_scanner.c:zend_safe_address
Unexecuted instantiation: zend_lazy_objects.c:zend_safe_address
Unexecuted instantiation: zend_list.c:zend_safe_address
Unexecuted instantiation: zend_llist.c:zend_safe_address
Unexecuted instantiation: zend_multibyte.c:zend_safe_address
Unexecuted instantiation: zend_object_handlers.c:zend_safe_address
Unexecuted instantiation: zend_objects_API.c:zend_safe_address
Unexecuted instantiation: zend_objects.c:zend_safe_address
Unexecuted instantiation: zend_observer.c:zend_safe_address
Unexecuted instantiation: zend_opcode.c:zend_safe_address
Unexecuted instantiation: zend_operators.c:zend_safe_address
Unexecuted instantiation: zend_property_hooks.c:zend_safe_address
Unexecuted instantiation: zend_ptr_stack.c:zend_safe_address
Unexecuted instantiation: zend_signal.c:zend_safe_address
Unexecuted instantiation: zend_smart_str.c:zend_safe_address
Unexecuted instantiation: zend_sort.c:zend_safe_address
Unexecuted instantiation: zend_stack.c:zend_safe_address
Unexecuted instantiation: zend_stream.c:zend_safe_address
Unexecuted instantiation: zend_string.c:zend_safe_address
Unexecuted instantiation: zend_strtod.c:zend_safe_address
Unexecuted instantiation: zend_system_id.c:zend_safe_address
Unexecuted instantiation: zend_variables.c:zend_safe_address
Unexecuted instantiation: zend_virtual_cwd.c:zend_safe_address
Unexecuted instantiation: zend_vm_opcodes.c:zend_safe_address
Unexecuted instantiation: zend_weakrefs.c:zend_safe_address
Unexecuted instantiation: zend.c:zend_safe_address
Unexecuted instantiation: internal_functions_cli.c:zend_safe_address
Unexecuted instantiation: fuzzer-parser.c:zend_safe_address
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_address
Unexecuted instantiation: fuzzer-tracing-jit.c:zend_safe_address
Unexecuted instantiation: fuzzer-exif.c:zend_safe_address
Unexecuted instantiation: fuzzer-unserialize.c:zend_safe_address
Unexecuted instantiation: fuzzer-function-jit.c:zend_safe_address
Unexecuted instantiation: fuzzer-json.c:zend_safe_address
Unexecuted instantiation: fuzzer-unserializehash.c:zend_safe_address
Unexecuted instantiation: fuzzer-execute.c:zend_safe_address
224
225
#elif defined(__GNUC__) && defined(__arm__)
226
227
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
228
{
229
  size_t res;
230
  zend_ulong m_overflow;
231
232
  __asm__ ("umlal %0,%1,%2,%3"
233
    : "=r"(res), "=r"(m_overflow)
234
    : "r"(nmemb),
235
      "r"(size),
236
      "0"(offset),
237
      "1"(0));
238
239
  if (UNEXPECTED(m_overflow)) {
240
    *overflow = 1;
241
    return 0;
242
  }
243
  *overflow = 0;
244
  return res;
245
}
246
247
#elif defined(__GNUC__) && defined(__aarch64__)
248
249
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
250
{
251
  size_t res;
252
  zend_ulong m_overflow;
253
254
  __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr"
255
    : "=&r"(res), "=&r"(m_overflow)
256
    : "r"(nmemb),
257
      "r"(size),
258
      "r"(offset));
259
260
  if (UNEXPECTED(m_overflow)) {
261
    *overflow = 1;
262
    return 0;
263
  }
264
  *overflow = 0;
265
  return res;
266
}
267
268
#elif defined(__GNUC__) && defined(__powerpc64__)
269
270
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
271
{
272
        size_t res;
273
        unsigned long m_overflow;
274
275
        __asm__ ("mulld %0,%2,%3\n\t"
276
                 "mulhdu %1,%2,%3\n\t"
277
                 "addc %0,%0,%4\n\t"
278
                 "addze %1,%1\n"
279
             : "=&r"(res), "=&r"(m_overflow)
280
             : "r"(nmemb),
281
               "r"(size),
282
               "r"(offset));
283
284
        if (UNEXPECTED(m_overflow)) {
285
                *overflow = 1;
286
                return 0;
287
        }
288
        *overflow = 0;
289
        return res;
290
}
291
292
#elif SIZEOF_SIZE_T == 4
293
294
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
295
{
296
  uint64_t res = (uint64_t) nmemb * (uint64_t) size + (uint64_t) offset;
297
298
  if (UNEXPECTED(res > UINT64_C(0xFFFFFFFF))) {
299
    *overflow = 1;
300
    return 0;
301
  }
302
  *overflow = 0;
303
  return (size_t) res;
304
}
305
306
#elif defined(_MSC_VER)
307
308
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
309
{
310
  size_t res;
311
  if (UNEXPECTED(FAILED(ULongLongMult(nmemb, size, &res)) || FAILED(ULongLongAdd(res, offset, &res)))) {
312
    *overflow = 1;
313
    return 0;
314
  }
315
  *overflow = 0;
316
  return res;
317
}
318
319
#else
320
321
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
322
{
323
  size_t res = nmemb * size + offset;
324
  double _d  = (double)nmemb * (double)size + (double)offset;
325
  double _delta = (double)res - _d;
326
327
  if (UNEXPECTED((_d + _delta ) != _d)) {
328
    *overflow = 1;
329
    return 0;
330
  }
331
  *overflow = 0;
332
  return res;
333
}
334
#endif
335
336
static zend_always_inline size_t zend_safe_address_guarded(size_t nmemb, size_t size, size_t offset)
337
361M
{
338
361M
  bool overflow;
339
361M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
361M
  if (UNEXPECTED(overflow)) {
342
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
343
0
    return 0;
344
0
  }
345
361M
  return ret;
346
361M
}
Unexecuted instantiation: php_date.c:zend_safe_address_guarded
Unexecuted instantiation: astro.c:zend_safe_address_guarded
Unexecuted instantiation: dow.c:zend_safe_address_guarded
Unexecuted instantiation: parse_date.c:zend_safe_address_guarded
Unexecuted instantiation: parse_tz.c:zend_safe_address_guarded
Unexecuted instantiation: parse_posix.c:zend_safe_address_guarded
Unexecuted instantiation: timelib.c:zend_safe_address_guarded
Unexecuted instantiation: tm2unixtime.c:zend_safe_address_guarded
Unexecuted instantiation: unixtime2tm.c:zend_safe_address_guarded
Unexecuted instantiation: parse_iso_intervals.c:zend_safe_address_guarded
Unexecuted instantiation: interval.c:zend_safe_address_guarded
php_pcre.c:zend_safe_address_guarded
Line
Count
Source
337
797
{
338
797
  bool overflow;
339
797
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
797
  if (UNEXPECTED(overflow)) {
342
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
343
0
    return 0;
344
0
  }
345
797
  return ret;
346
797
}
Unexecuted instantiation: exif.c:zend_safe_address_guarded
Unexecuted instantiation: hash_adler32.c:zend_safe_address_guarded
Unexecuted instantiation: hash_crc32.c:zend_safe_address_guarded
Unexecuted instantiation: hash_fnv.c:zend_safe_address_guarded
Unexecuted instantiation: hash_gost.c:zend_safe_address_guarded
Unexecuted instantiation: hash_haval.c:zend_safe_address_guarded
Unexecuted instantiation: hash_joaat.c:zend_safe_address_guarded
Unexecuted instantiation: hash_md.c:zend_safe_address_guarded
Unexecuted instantiation: hash_murmur.c:zend_safe_address_guarded
Unexecuted instantiation: hash_ripemd.c:zend_safe_address_guarded
Unexecuted instantiation: hash_sha_ni.c:zend_safe_address_guarded
Unexecuted instantiation: hash_sha_sse2.c:zend_safe_address_guarded
Unexecuted instantiation: hash_sha.c:zend_safe_address_guarded
Unexecuted instantiation: hash_sha3.c:zend_safe_address_guarded
Unexecuted instantiation: hash_snefru.c:zend_safe_address_guarded
Unexecuted instantiation: hash_tiger.c:zend_safe_address_guarded
Unexecuted instantiation: hash_whirlpool.c:zend_safe_address_guarded
Unexecuted instantiation: hash_xxhash.c:zend_safe_address_guarded
Unexecuted instantiation: hash.c:zend_safe_address_guarded
Unexecuted instantiation: json_encoder.c:zend_safe_address_guarded
Unexecuted instantiation: json_parser.tab.c:zend_safe_address_guarded
Unexecuted instantiation: json_scanner.c:zend_safe_address_guarded
Unexecuted instantiation: json.c:zend_safe_address_guarded
Unexecuted instantiation: php_lexbor.c:zend_safe_address_guarded
Unexecuted instantiation: csprng.c:zend_safe_address_guarded
Unexecuted instantiation: engine_mt19937.c:zend_safe_address_guarded
Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:zend_safe_address_guarded
Unexecuted instantiation: engine_secure.c:zend_safe_address_guarded
Unexecuted instantiation: engine_user.c:zend_safe_address_guarded
Unexecuted instantiation: engine_xoshiro256starstar.c:zend_safe_address_guarded
Unexecuted instantiation: gammasection.c:zend_safe_address_guarded
Unexecuted instantiation: random.c:zend_safe_address_guarded
Unexecuted instantiation: randomizer.c:zend_safe_address_guarded
Unexecuted instantiation: zend_utils.c:zend_safe_address_guarded
Unexecuted instantiation: php_reflection.c:zend_safe_address_guarded
Unexecuted instantiation: php_spl.c:zend_safe_address_guarded
Unexecuted instantiation: spl_array.c:zend_safe_address_guarded
Unexecuted instantiation: spl_directory.c:zend_safe_address_guarded
Unexecuted instantiation: spl_dllist.c:zend_safe_address_guarded
Unexecuted instantiation: spl_exceptions.c:zend_safe_address_guarded
Unexecuted instantiation: spl_fixedarray.c:zend_safe_address_guarded
Unexecuted instantiation: spl_functions.c:zend_safe_address_guarded
Unexecuted instantiation: spl_heap.c:zend_safe_address_guarded
Unexecuted instantiation: spl_iterators.c:zend_safe_address_guarded
Unexecuted instantiation: spl_observer.c:zend_safe_address_guarded
Unexecuted instantiation: array.c:zend_safe_address_guarded
Unexecuted instantiation: assert.c:zend_safe_address_guarded
Unexecuted instantiation: base64.c:zend_safe_address_guarded
Unexecuted instantiation: basic_functions.c:zend_safe_address_guarded
Unexecuted instantiation: browscap.c:zend_safe_address_guarded
Unexecuted instantiation: crc32_x86.c:zend_safe_address_guarded
Unexecuted instantiation: crc32.c:zend_safe_address_guarded
Unexecuted instantiation: credits.c:zend_safe_address_guarded
Unexecuted instantiation: crypt.c:zend_safe_address_guarded
Unexecuted instantiation: css.c:zend_safe_address_guarded
Unexecuted instantiation: datetime.c:zend_safe_address_guarded
Unexecuted instantiation: dir.c:zend_safe_address_guarded
Unexecuted instantiation: dl.c:zend_safe_address_guarded
Unexecuted instantiation: dns.c:zend_safe_address_guarded
Unexecuted instantiation: exec.c:zend_safe_address_guarded
Unexecuted instantiation: file.c:zend_safe_address_guarded
Unexecuted instantiation: filestat.c:zend_safe_address_guarded
Unexecuted instantiation: filters.c:zend_safe_address_guarded
Unexecuted instantiation: flock_compat.c:zend_safe_address_guarded
Unexecuted instantiation: formatted_print.c:zend_safe_address_guarded
Unexecuted instantiation: fsock.c:zend_safe_address_guarded
Unexecuted instantiation: ftok.c:zend_safe_address_guarded
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: head.c:zend_safe_address_guarded
Unexecuted instantiation: hrtime.c:zend_safe_address_guarded
Unexecuted instantiation: html.c:zend_safe_address_guarded
Unexecuted instantiation: http_fopen_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: http.c:zend_safe_address_guarded
Unexecuted instantiation: image.c:zend_safe_address_guarded
Unexecuted instantiation: incomplete_class.c:zend_safe_address_guarded
Unexecuted instantiation: info.c:zend_safe_address_guarded
Unexecuted instantiation: iptc.c:zend_safe_address_guarded
Unexecuted instantiation: levenshtein.c:zend_safe_address_guarded
Unexecuted instantiation: link.c:zend_safe_address_guarded
Unexecuted instantiation: mail.c:zend_safe_address_guarded
Unexecuted instantiation: math.c:zend_safe_address_guarded
Unexecuted instantiation: md5.c:zend_safe_address_guarded
Unexecuted instantiation: metaphone.c:zend_safe_address_guarded
Unexecuted instantiation: microtime.c:zend_safe_address_guarded
Unexecuted instantiation: net.c:zend_safe_address_guarded
Unexecuted instantiation: pack.c:zend_safe_address_guarded
Unexecuted instantiation: pageinfo.c:zend_safe_address_guarded
Unexecuted instantiation: password.c:zend_safe_address_guarded
Unexecuted instantiation: php_fopen_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: proc_open.c:zend_safe_address_guarded
Unexecuted instantiation: quot_print.c:zend_safe_address_guarded
Unexecuted instantiation: scanf.c:zend_safe_address_guarded
Unexecuted instantiation: sha1.c:zend_safe_address_guarded
Unexecuted instantiation: soundex.c:zend_safe_address_guarded
Unexecuted instantiation: streamsfuncs.c:zend_safe_address_guarded
Unexecuted instantiation: string.c:zend_safe_address_guarded
Unexecuted instantiation: strnatcmp.c:zend_safe_address_guarded
Unexecuted instantiation: syslog.c:zend_safe_address_guarded
Unexecuted instantiation: type.c:zend_safe_address_guarded
Unexecuted instantiation: uniqid.c:zend_safe_address_guarded
Unexecuted instantiation: url_scanner_ex.c:zend_safe_address_guarded
Unexecuted instantiation: url.c:zend_safe_address_guarded
Unexecuted instantiation: user_filters.c:zend_safe_address_guarded
Unexecuted instantiation: uuencode.c:zend_safe_address_guarded
Unexecuted instantiation: var_unserializer.c:zend_safe_address_guarded
Unexecuted instantiation: var.c:zend_safe_address_guarded
Unexecuted instantiation: versioning.c:zend_safe_address_guarded
Unexecuted instantiation: crypt_sha256.c:zend_safe_address_guarded
Unexecuted instantiation: crypt_sha512.c:zend_safe_address_guarded
Unexecuted instantiation: php_crypt_r.c:zend_safe_address_guarded
Unexecuted instantiation: php_uri.c:zend_safe_address_guarded
Unexecuted instantiation: php_uri_common.c:zend_safe_address_guarded
Unexecuted instantiation: php_uriparser.c:zend_safe_address_guarded
Unexecuted instantiation: explicit_bzero.c:zend_safe_address_guarded
Unexecuted instantiation: fopen_wrappers.c:zend_safe_address_guarded
Unexecuted instantiation: getopt.c:zend_safe_address_guarded
Unexecuted instantiation: main.c:zend_safe_address_guarded
Unexecuted instantiation: network.c:zend_safe_address_guarded
Unexecuted instantiation: output.c:zend_safe_address_guarded
Unexecuted instantiation: php_content_types.c:zend_safe_address_guarded
Unexecuted instantiation: php_ini_builder.c:zend_safe_address_guarded
Unexecuted instantiation: php_ini.c:zend_safe_address_guarded
Unexecuted instantiation: php_glob.c:zend_safe_address_guarded
Unexecuted instantiation: php_odbc_utils.c:zend_safe_address_guarded
Unexecuted instantiation: php_open_temporary_file.c:zend_safe_address_guarded
Unexecuted instantiation: php_scandir.c:zend_safe_address_guarded
Unexecuted instantiation: php_syslog.c:zend_safe_address_guarded
Unexecuted instantiation: php_ticks.c:zend_safe_address_guarded
Unexecuted instantiation: php_variables.c:zend_safe_address_guarded
Unexecuted instantiation: reentrancy.c:zend_safe_address_guarded
Unexecuted instantiation: rfc1867.c:zend_safe_address_guarded
Unexecuted instantiation: safe_bcmp.c:zend_safe_address_guarded
Unexecuted instantiation: SAPI.c:zend_safe_address_guarded
Unexecuted instantiation: snprintf.c:zend_safe_address_guarded
Unexecuted instantiation: spprintf.c:zend_safe_address_guarded
Unexecuted instantiation: strlcat.c:zend_safe_address_guarded
Unexecuted instantiation: strlcpy.c:zend_safe_address_guarded
Unexecuted instantiation: cast.c:zend_safe_address_guarded
Unexecuted instantiation: filter.c:zend_safe_address_guarded
Unexecuted instantiation: glob_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: memory.c:zend_safe_address_guarded
Unexecuted instantiation: mmap.c:zend_safe_address_guarded
Unexecuted instantiation: plain_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: streams.c:zend_safe_address_guarded
Unexecuted instantiation: transports.c:zend_safe_address_guarded
Unexecuted instantiation: userspace.c:zend_safe_address_guarded
Unexecuted instantiation: xp_socket.c:zend_safe_address_guarded
Unexecuted instantiation: block_pass.c:zend_safe_address_guarded
Unexecuted instantiation: compact_literals.c:zend_safe_address_guarded
Unexecuted instantiation: compact_vars.c:zend_safe_address_guarded
Unexecuted instantiation: dce.c:zend_safe_address_guarded
Unexecuted instantiation: dfa_pass.c:zend_safe_address_guarded
Unexecuted instantiation: escape_analysis.c:zend_safe_address_guarded
Unexecuted instantiation: nop_removal.c:zend_safe_address_guarded
Unexecuted instantiation: optimize_func_calls.c:zend_safe_address_guarded
Unexecuted instantiation: optimize_temp_vars_5.c:zend_safe_address_guarded
Unexecuted instantiation: pass1.c:zend_safe_address_guarded
Unexecuted instantiation: pass3.c:zend_safe_address_guarded
Unexecuted instantiation: sccp.c:zend_safe_address_guarded
Unexecuted instantiation: scdf.c:zend_safe_address_guarded
Unexecuted instantiation: zend_call_graph.c:zend_safe_address_guarded
Unexecuted instantiation: zend_cfg.c:zend_safe_address_guarded
Unexecuted instantiation: zend_dfg.c:zend_safe_address_guarded
Unexecuted instantiation: zend_dump.c:zend_safe_address_guarded
Unexecuted instantiation: zend_func_info.c:zend_safe_address_guarded
Unexecuted instantiation: zend_inference.c:zend_safe_address_guarded
Unexecuted instantiation: zend_optimizer.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ssa.c:zend_safe_address_guarded
zend_alloc.c:zend_safe_address_guarded
Line
Count
Source
337
361M
{
338
361M
  bool overflow;
339
361M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
361M
  if (UNEXPECTED(overflow)) {
342
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
343
0
    return 0;
344
0
  }
345
361M
  return ret;
346
361M
}
Unexecuted instantiation: zend_API.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ast.c:zend_safe_address_guarded
Unexecuted instantiation: zend_attributes.c:zend_safe_address_guarded
Unexecuted instantiation: zend_builtin_functions.c:zend_safe_address_guarded
Unexecuted instantiation: zend_call_stack.c:zend_safe_address_guarded
Unexecuted instantiation: zend_closures.c:zend_safe_address_guarded
Unexecuted instantiation: zend_compile.c:zend_safe_address_guarded
Unexecuted instantiation: zend_constants.c:zend_safe_address_guarded
Unexecuted instantiation: zend_cpuinfo.c:zend_safe_address_guarded
Unexecuted instantiation: zend_default_classes.c:zend_safe_address_guarded
Unexecuted instantiation: zend_dtrace.c:zend_safe_address_guarded
Unexecuted instantiation: zend_enum.c:zend_safe_address_guarded
Unexecuted instantiation: zend_exceptions.c:zend_safe_address_guarded
Unexecuted instantiation: zend_execute_API.c:zend_safe_address_guarded
Unexecuted instantiation: zend_execute.c:zend_safe_address_guarded
Unexecuted instantiation: zend_extensions.c:zend_safe_address_guarded
Unexecuted instantiation: zend_fibers.c:zend_safe_address_guarded
Unexecuted instantiation: zend_float.c:zend_safe_address_guarded
Unexecuted instantiation: zend_gc.c:zend_safe_address_guarded
Unexecuted instantiation: zend_gdb.c:zend_safe_address_guarded
Unexecuted instantiation: zend_generators.c:zend_safe_address_guarded
Unexecuted instantiation: zend_hash.c:zend_safe_address_guarded
Unexecuted instantiation: zend_highlight.c:zend_safe_address_guarded
Unexecuted instantiation: zend_hrtime.c:zend_safe_address_guarded
Unexecuted instantiation: zend_inheritance.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ini_parser.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ini_scanner.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ini.c:zend_safe_address_guarded
Unexecuted instantiation: zend_interfaces.c:zend_safe_address_guarded
Unexecuted instantiation: zend_iterators.c:zend_safe_address_guarded
Unexecuted instantiation: zend_language_parser.c:zend_safe_address_guarded
Unexecuted instantiation: zend_language_scanner.c:zend_safe_address_guarded
Unexecuted instantiation: zend_lazy_objects.c:zend_safe_address_guarded
Unexecuted instantiation: zend_list.c:zend_safe_address_guarded
Unexecuted instantiation: zend_llist.c:zend_safe_address_guarded
Unexecuted instantiation: zend_multibyte.c:zend_safe_address_guarded
Unexecuted instantiation: zend_object_handlers.c:zend_safe_address_guarded
Unexecuted instantiation: zend_objects_API.c:zend_safe_address_guarded
Unexecuted instantiation: zend_objects.c:zend_safe_address_guarded
Unexecuted instantiation: zend_observer.c:zend_safe_address_guarded
Unexecuted instantiation: zend_opcode.c:zend_safe_address_guarded
Unexecuted instantiation: zend_operators.c:zend_safe_address_guarded
Unexecuted instantiation: zend_property_hooks.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ptr_stack.c:zend_safe_address_guarded
Unexecuted instantiation: zend_signal.c:zend_safe_address_guarded
Unexecuted instantiation: zend_smart_str.c:zend_safe_address_guarded
Unexecuted instantiation: zend_sort.c:zend_safe_address_guarded
Unexecuted instantiation: zend_stack.c:zend_safe_address_guarded
Unexecuted instantiation: zend_stream.c:zend_safe_address_guarded
Unexecuted instantiation: zend_string.c:zend_safe_address_guarded
Unexecuted instantiation: zend_strtod.c:zend_safe_address_guarded
Unexecuted instantiation: zend_system_id.c:zend_safe_address_guarded
Unexecuted instantiation: zend_variables.c:zend_safe_address_guarded
Unexecuted instantiation: zend_virtual_cwd.c:zend_safe_address_guarded
Unexecuted instantiation: zend_vm_opcodes.c:zend_safe_address_guarded
Unexecuted instantiation: zend_weakrefs.c:zend_safe_address_guarded
Unexecuted instantiation: zend.c:zend_safe_address_guarded
Unexecuted instantiation: internal_functions_cli.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-parser.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-tracing-jit.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-exif.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-unserialize.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-function-jit.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-json.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-unserializehash.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-execute.c:zend_safe_address_guarded
347
348
/* A bit more generic version of the same */
349
static zend_always_inline size_t zend_safe_addmult(size_t nmemb, size_t size, size_t offset, const char *message)
350
1.37k
{
351
1.37k
  bool overflow;
352
1.37k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
1.37k
  if (UNEXPECTED(overflow)) {
355
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
356
0
    return 0;
357
0
  }
358
1.37k
  return ret;
359
1.37k
}
Unexecuted instantiation: php_date.c:zend_safe_addmult
Unexecuted instantiation: astro.c:zend_safe_addmult
Unexecuted instantiation: dow.c:zend_safe_addmult
Unexecuted instantiation: parse_date.c:zend_safe_addmult
Unexecuted instantiation: parse_tz.c:zend_safe_addmult
Unexecuted instantiation: parse_posix.c:zend_safe_addmult
Unexecuted instantiation: timelib.c:zend_safe_addmult
Unexecuted instantiation: tm2unixtime.c:zend_safe_addmult
Unexecuted instantiation: unixtime2tm.c:zend_safe_addmult
Unexecuted instantiation: parse_iso_intervals.c:zend_safe_addmult
Unexecuted instantiation: interval.c:zend_safe_addmult
Unexecuted instantiation: php_pcre.c:zend_safe_addmult
Unexecuted instantiation: exif.c:zend_safe_addmult
Unexecuted instantiation: hash_adler32.c:zend_safe_addmult
Unexecuted instantiation: hash_crc32.c:zend_safe_addmult
Unexecuted instantiation: hash_fnv.c:zend_safe_addmult
Unexecuted instantiation: hash_gost.c:zend_safe_addmult
Unexecuted instantiation: hash_haval.c:zend_safe_addmult
Unexecuted instantiation: hash_joaat.c:zend_safe_addmult
Unexecuted instantiation: hash_md.c:zend_safe_addmult
Unexecuted instantiation: hash_murmur.c:zend_safe_addmult
Unexecuted instantiation: hash_ripemd.c:zend_safe_addmult
Unexecuted instantiation: hash_sha_ni.c:zend_safe_addmult
Unexecuted instantiation: hash_sha_sse2.c:zend_safe_addmult
Unexecuted instantiation: hash_sha.c:zend_safe_addmult
Unexecuted instantiation: hash_sha3.c:zend_safe_addmult
Unexecuted instantiation: hash_snefru.c:zend_safe_addmult
Unexecuted instantiation: hash_tiger.c:zend_safe_addmult
Unexecuted instantiation: hash_whirlpool.c:zend_safe_addmult
Unexecuted instantiation: hash_xxhash.c:zend_safe_addmult
Unexecuted instantiation: hash.c:zend_safe_addmult
Unexecuted instantiation: json_encoder.c:zend_safe_addmult
Unexecuted instantiation: json_parser.tab.c:zend_safe_addmult
Unexecuted instantiation: json_scanner.c:zend_safe_addmult
Unexecuted instantiation: json.c:zend_safe_addmult
Unexecuted instantiation: php_lexbor.c:zend_safe_addmult
Unexecuted instantiation: csprng.c:zend_safe_addmult
Unexecuted instantiation: engine_mt19937.c:zend_safe_addmult
Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:zend_safe_addmult
Unexecuted instantiation: engine_secure.c:zend_safe_addmult
Unexecuted instantiation: engine_user.c:zend_safe_addmult
Unexecuted instantiation: engine_xoshiro256starstar.c:zend_safe_addmult
Unexecuted instantiation: gammasection.c:zend_safe_addmult
Unexecuted instantiation: random.c:zend_safe_addmult
Unexecuted instantiation: randomizer.c:zend_safe_addmult
Unexecuted instantiation: zend_utils.c:zend_safe_addmult
Unexecuted instantiation: php_reflection.c:zend_safe_addmult
Unexecuted instantiation: php_spl.c:zend_safe_addmult
Unexecuted instantiation: spl_array.c:zend_safe_addmult
Unexecuted instantiation: spl_directory.c:zend_safe_addmult
Unexecuted instantiation: spl_dllist.c:zend_safe_addmult
Unexecuted instantiation: spl_exceptions.c:zend_safe_addmult
Unexecuted instantiation: spl_fixedarray.c:zend_safe_addmult
Unexecuted instantiation: spl_functions.c:zend_safe_addmult
Unexecuted instantiation: spl_heap.c:zend_safe_addmult
Unexecuted instantiation: spl_iterators.c:zend_safe_addmult
Unexecuted instantiation: spl_observer.c:zend_safe_addmult
Unexecuted instantiation: array.c:zend_safe_addmult
Unexecuted instantiation: assert.c:zend_safe_addmult
Unexecuted instantiation: base64.c:zend_safe_addmult
Unexecuted instantiation: basic_functions.c:zend_safe_addmult
Unexecuted instantiation: browscap.c:zend_safe_addmult
Unexecuted instantiation: crc32_x86.c:zend_safe_addmult
Unexecuted instantiation: crc32.c:zend_safe_addmult
Unexecuted instantiation: credits.c:zend_safe_addmult
Unexecuted instantiation: crypt.c:zend_safe_addmult
Unexecuted instantiation: css.c:zend_safe_addmult
Unexecuted instantiation: datetime.c:zend_safe_addmult
Unexecuted instantiation: dir.c:zend_safe_addmult
Unexecuted instantiation: dl.c:zend_safe_addmult
Unexecuted instantiation: dns.c:zend_safe_addmult
Unexecuted instantiation: exec.c:zend_safe_addmult
Unexecuted instantiation: file.c:zend_safe_addmult
Unexecuted instantiation: filestat.c:zend_safe_addmult
Unexecuted instantiation: filters.c:zend_safe_addmult
Unexecuted instantiation: flock_compat.c:zend_safe_addmult
Unexecuted instantiation: formatted_print.c:zend_safe_addmult
Unexecuted instantiation: fsock.c:zend_safe_addmult
Unexecuted instantiation: ftok.c:zend_safe_addmult
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_safe_addmult
Unexecuted instantiation: head.c:zend_safe_addmult
Unexecuted instantiation: hrtime.c:zend_safe_addmult
html.c:zend_safe_addmult
Line
Count
Source
350
1.37k
{
351
1.37k
  bool overflow;
352
1.37k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
1.37k
  if (UNEXPECTED(overflow)) {
355
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
356
0
    return 0;
357
0
  }
358
1.37k
  return ret;
359
1.37k
}
Unexecuted instantiation: http_fopen_wrapper.c:zend_safe_addmult
Unexecuted instantiation: http.c:zend_safe_addmult
Unexecuted instantiation: image.c:zend_safe_addmult
Unexecuted instantiation: incomplete_class.c:zend_safe_addmult
Unexecuted instantiation: info.c:zend_safe_addmult
Unexecuted instantiation: iptc.c:zend_safe_addmult
Unexecuted instantiation: levenshtein.c:zend_safe_addmult
Unexecuted instantiation: link.c:zend_safe_addmult
Unexecuted instantiation: mail.c:zend_safe_addmult
Unexecuted instantiation: math.c:zend_safe_addmult
Unexecuted instantiation: md5.c:zend_safe_addmult
Unexecuted instantiation: metaphone.c:zend_safe_addmult
Unexecuted instantiation: microtime.c:zend_safe_addmult
Unexecuted instantiation: net.c:zend_safe_addmult
Unexecuted instantiation: pack.c:zend_safe_addmult
Unexecuted instantiation: pageinfo.c:zend_safe_addmult
Unexecuted instantiation: password.c:zend_safe_addmult
Unexecuted instantiation: php_fopen_wrapper.c:zend_safe_addmult
Unexecuted instantiation: proc_open.c:zend_safe_addmult
Unexecuted instantiation: quot_print.c:zend_safe_addmult
Unexecuted instantiation: scanf.c:zend_safe_addmult
Unexecuted instantiation: sha1.c:zend_safe_addmult
Unexecuted instantiation: soundex.c:zend_safe_addmult
Unexecuted instantiation: streamsfuncs.c:zend_safe_addmult
Unexecuted instantiation: string.c:zend_safe_addmult
Unexecuted instantiation: strnatcmp.c:zend_safe_addmult
Unexecuted instantiation: syslog.c:zend_safe_addmult
Unexecuted instantiation: type.c:zend_safe_addmult
Unexecuted instantiation: uniqid.c:zend_safe_addmult
Unexecuted instantiation: url_scanner_ex.c:zend_safe_addmult
Unexecuted instantiation: url.c:zend_safe_addmult
Unexecuted instantiation: user_filters.c:zend_safe_addmult
Unexecuted instantiation: uuencode.c:zend_safe_addmult
Unexecuted instantiation: var_unserializer.c:zend_safe_addmult
Unexecuted instantiation: var.c:zend_safe_addmult
Unexecuted instantiation: versioning.c:zend_safe_addmult
Unexecuted instantiation: crypt_sha256.c:zend_safe_addmult
Unexecuted instantiation: crypt_sha512.c:zend_safe_addmult
Unexecuted instantiation: php_crypt_r.c:zend_safe_addmult
Unexecuted instantiation: php_uri.c:zend_safe_addmult
Unexecuted instantiation: php_uri_common.c:zend_safe_addmult
Unexecuted instantiation: php_uriparser.c:zend_safe_addmult
Unexecuted instantiation: explicit_bzero.c:zend_safe_addmult
Unexecuted instantiation: fopen_wrappers.c:zend_safe_addmult
Unexecuted instantiation: getopt.c:zend_safe_addmult
Unexecuted instantiation: main.c:zend_safe_addmult
Unexecuted instantiation: network.c:zend_safe_addmult
Unexecuted instantiation: output.c:zend_safe_addmult
Unexecuted instantiation: php_content_types.c:zend_safe_addmult
Unexecuted instantiation: php_ini_builder.c:zend_safe_addmult
Unexecuted instantiation: php_ini.c:zend_safe_addmult
Unexecuted instantiation: php_glob.c:zend_safe_addmult
Unexecuted instantiation: php_odbc_utils.c:zend_safe_addmult
Unexecuted instantiation: php_open_temporary_file.c:zend_safe_addmult
Unexecuted instantiation: php_scandir.c:zend_safe_addmult
Unexecuted instantiation: php_syslog.c:zend_safe_addmult
Unexecuted instantiation: php_ticks.c:zend_safe_addmult
Unexecuted instantiation: php_variables.c:zend_safe_addmult
Unexecuted instantiation: reentrancy.c:zend_safe_addmult
Unexecuted instantiation: rfc1867.c:zend_safe_addmult
Unexecuted instantiation: safe_bcmp.c:zend_safe_addmult
Unexecuted instantiation: SAPI.c:zend_safe_addmult
Unexecuted instantiation: snprintf.c:zend_safe_addmult
Unexecuted instantiation: spprintf.c:zend_safe_addmult
Unexecuted instantiation: strlcat.c:zend_safe_addmult
Unexecuted instantiation: strlcpy.c:zend_safe_addmult
Unexecuted instantiation: cast.c:zend_safe_addmult
Unexecuted instantiation: filter.c:zend_safe_addmult
Unexecuted instantiation: glob_wrapper.c:zend_safe_addmult
Unexecuted instantiation: memory.c:zend_safe_addmult
Unexecuted instantiation: mmap.c:zend_safe_addmult
Unexecuted instantiation: plain_wrapper.c:zend_safe_addmult
Unexecuted instantiation: streams.c:zend_safe_addmult
Unexecuted instantiation: transports.c:zend_safe_addmult
Unexecuted instantiation: userspace.c:zend_safe_addmult
Unexecuted instantiation: xp_socket.c:zend_safe_addmult
Unexecuted instantiation: block_pass.c:zend_safe_addmult
Unexecuted instantiation: compact_literals.c:zend_safe_addmult
Unexecuted instantiation: compact_vars.c:zend_safe_addmult
Unexecuted instantiation: dce.c:zend_safe_addmult
Unexecuted instantiation: dfa_pass.c:zend_safe_addmult
Unexecuted instantiation: escape_analysis.c:zend_safe_addmult
Unexecuted instantiation: nop_removal.c:zend_safe_addmult
Unexecuted instantiation: optimize_func_calls.c:zend_safe_addmult
Unexecuted instantiation: optimize_temp_vars_5.c:zend_safe_addmult
Unexecuted instantiation: pass1.c:zend_safe_addmult
Unexecuted instantiation: pass3.c:zend_safe_addmult
Unexecuted instantiation: sccp.c:zend_safe_addmult
Unexecuted instantiation: scdf.c:zend_safe_addmult
Unexecuted instantiation: zend_call_graph.c:zend_safe_addmult
Unexecuted instantiation: zend_cfg.c:zend_safe_addmult
Unexecuted instantiation: zend_dfg.c:zend_safe_addmult
Unexecuted instantiation: zend_dump.c:zend_safe_addmult
Unexecuted instantiation: zend_func_info.c:zend_safe_addmult
Unexecuted instantiation: zend_inference.c:zend_safe_addmult
Unexecuted instantiation: zend_optimizer.c:zend_safe_addmult
Unexecuted instantiation: zend_ssa.c:zend_safe_addmult
Unexecuted instantiation: zend_alloc.c:zend_safe_addmult
Unexecuted instantiation: zend_API.c:zend_safe_addmult
Unexecuted instantiation: zend_ast.c:zend_safe_addmult
Unexecuted instantiation: zend_attributes.c:zend_safe_addmult
Unexecuted instantiation: zend_builtin_functions.c:zend_safe_addmult
Unexecuted instantiation: zend_call_stack.c:zend_safe_addmult
Unexecuted instantiation: zend_closures.c:zend_safe_addmult
Unexecuted instantiation: zend_compile.c:zend_safe_addmult
Unexecuted instantiation: zend_constants.c:zend_safe_addmult
Unexecuted instantiation: zend_cpuinfo.c:zend_safe_addmult
Unexecuted instantiation: zend_default_classes.c:zend_safe_addmult
Unexecuted instantiation: zend_dtrace.c:zend_safe_addmult
Unexecuted instantiation: zend_enum.c:zend_safe_addmult
Unexecuted instantiation: zend_exceptions.c:zend_safe_addmult
Unexecuted instantiation: zend_execute_API.c:zend_safe_addmult
Unexecuted instantiation: zend_execute.c:zend_safe_addmult
Unexecuted instantiation: zend_extensions.c:zend_safe_addmult
Unexecuted instantiation: zend_fibers.c:zend_safe_addmult
Unexecuted instantiation: zend_float.c:zend_safe_addmult
Unexecuted instantiation: zend_gc.c:zend_safe_addmult
Unexecuted instantiation: zend_gdb.c:zend_safe_addmult
Unexecuted instantiation: zend_generators.c:zend_safe_addmult
Unexecuted instantiation: zend_hash.c:zend_safe_addmult
Unexecuted instantiation: zend_highlight.c:zend_safe_addmult
Unexecuted instantiation: zend_hrtime.c:zend_safe_addmult
Unexecuted instantiation: zend_inheritance.c:zend_safe_addmult
Unexecuted instantiation: zend_ini_parser.c:zend_safe_addmult
Unexecuted instantiation: zend_ini_scanner.c:zend_safe_addmult
Unexecuted instantiation: zend_ini.c:zend_safe_addmult
Unexecuted instantiation: zend_interfaces.c:zend_safe_addmult
Unexecuted instantiation: zend_iterators.c:zend_safe_addmult
Unexecuted instantiation: zend_language_parser.c:zend_safe_addmult
Unexecuted instantiation: zend_language_scanner.c:zend_safe_addmult
Unexecuted instantiation: zend_lazy_objects.c:zend_safe_addmult
Unexecuted instantiation: zend_list.c:zend_safe_addmult
Unexecuted instantiation: zend_llist.c:zend_safe_addmult
Unexecuted instantiation: zend_multibyte.c:zend_safe_addmult
Unexecuted instantiation: zend_object_handlers.c:zend_safe_addmult
Unexecuted instantiation: zend_objects_API.c:zend_safe_addmult
Unexecuted instantiation: zend_objects.c:zend_safe_addmult
Unexecuted instantiation: zend_observer.c:zend_safe_addmult
Unexecuted instantiation: zend_opcode.c:zend_safe_addmult
Unexecuted instantiation: zend_operators.c:zend_safe_addmult
Unexecuted instantiation: zend_property_hooks.c:zend_safe_addmult
Unexecuted instantiation: zend_ptr_stack.c:zend_safe_addmult
Unexecuted instantiation: zend_signal.c:zend_safe_addmult
Unexecuted instantiation: zend_smart_str.c:zend_safe_addmult
Unexecuted instantiation: zend_sort.c:zend_safe_addmult
Unexecuted instantiation: zend_stack.c:zend_safe_addmult
Unexecuted instantiation: zend_stream.c:zend_safe_addmult
Unexecuted instantiation: zend_string.c:zend_safe_addmult
Unexecuted instantiation: zend_strtod.c:zend_safe_addmult
Unexecuted instantiation: zend_system_id.c:zend_safe_addmult
Unexecuted instantiation: zend_variables.c:zend_safe_addmult
Unexecuted instantiation: zend_virtual_cwd.c:zend_safe_addmult
Unexecuted instantiation: zend_vm_opcodes.c:zend_safe_addmult
Unexecuted instantiation: zend_weakrefs.c:zend_safe_addmult
Unexecuted instantiation: zend.c:zend_safe_addmult
Unexecuted instantiation: internal_functions_cli.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-parser.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-tracing-jit.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-exif.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-unserialize.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-function-jit.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-json.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-unserializehash.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-execute.c:zend_safe_addmult
360
361
#endif /* ZEND_MULTIPLY_H */