Coverage Report

Created: 2025-11-16 06:23

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/php-src/Zend/zend_multiply.h
Line
Count
Source
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
124k
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
28
124k
  long __tmpvar;                          \
29
124k
  if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \
30
22.4k
    (dval) = (double) (a) * (double) (b);           \
31
22.4k
  }                                \
32
124k
  else (lval) = __tmpvar;                     \
33
124k
} 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
226M
{
181
226M
  size_t res;
182
226M
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
226M
# define LP_SUFF "q"
188
226M
#endif
189
190
226M
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
222M
    res = nmemb;
192
222M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
222M
      "adc $0,%1"
194
222M
      : "=&a"(res), "=&d" (m_overflow)
195
222M
      : "%0"(res),
196
222M
        "rm"(size)
197
222M
      : "cc");
198
222M
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
171
    res = size;
200
171
    __asm__ ("add %2, %0\n\t"
201
171
      "adc $0,%1"
202
171
      : "+r"(res), "+r" (m_overflow)
203
171
      : "rm"(offset)
204
171
      : "cc");
205
3.80M
  } else {
206
3.80M
    res = nmemb;
207
3.80M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
3.80M
      "add %4,%0\n\t"
209
3.80M
      "adc $0,%1"
210
3.80M
      : "=&a"(res), "=&d" (m_overflow)
211
3.80M
      : "%0"(res),
212
3.80M
        "rm"(size),
213
3.80M
        "rm"(offset)
214
3.80M
      : "cc");
215
3.80M
  }
216
226M
#undef LP_SUFF
217
226M
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
226M
  *overflow = 0;
222
226M
  return res;
223
226M
}
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
460
{
181
460
  size_t res;
182
460
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
460
# define LP_SUFF "q"
188
460
#endif
189
190
460
  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
460
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
171
    res = size;
200
171
    __asm__ ("add %2, %0\n\t"
201
171
      "adc $0,%1"
202
171
      : "+r"(res), "+r" (m_overflow)
203
171
      : "rm"(offset)
204
171
      : "cc");
205
289
  } else {
206
289
    res = nmemb;
207
289
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
289
      "add %4,%0\n\t"
209
289
      "adc $0,%1"
210
289
      : "=&a"(res), "=&d" (m_overflow)
211
289
      : "%0"(res),
212
289
        "rm"(size),
213
289
        "rm"(offset)
214
289
      : "cc");
215
289
  }
216
460
#undef LP_SUFF
217
460
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
460
  *overflow = 0;
222
460
  return res;
223
460
}
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: shared_alloc_mmap.c:zend_safe_address
Unexecuted instantiation: shared_alloc_posix.c:zend_safe_address
Unexecuted instantiation: shared_alloc_shm.c:zend_safe_address
Unexecuted instantiation: zend_accelerator_api.c:zend_safe_address
Unexecuted instantiation: zend_accelerator_blacklist.c:zend_safe_address
Unexecuted instantiation: zend_accelerator_debug.c:zend_safe_address
Unexecuted instantiation: zend_accelerator_hash.c:zend_safe_address
Unexecuted instantiation: zend_accelerator_module.c:zend_safe_address
Unexecuted instantiation: zend_accelerator_util_funcs.c:zend_safe_address
Unexecuted instantiation: zend_file_cache.c:zend_safe_address
Unexecuted instantiation: zend_persist_calc.c:zend_safe_address
Unexecuted instantiation: zend_persist.c:zend_safe_address
Unexecuted instantiation: zend_shared_alloc.c:zend_safe_address
Unexecuted instantiation: ZendAccelerator.c:zend_safe_address
Unexecuted instantiation: ir_cfg.c:zend_safe_address
Unexecuted instantiation: ir_check.c:zend_safe_address
Unexecuted instantiation: ir_dump.c:zend_safe_address
Unexecuted instantiation: ir_emit.c:zend_safe_address
Unexecuted instantiation: ir_gcm.c:zend_safe_address
Unexecuted instantiation: ir_gdb.c:zend_safe_address
Unexecuted instantiation: ir_patch.c:zend_safe_address
Unexecuted instantiation: ir_perf.c:zend_safe_address
Unexecuted instantiation: ir_ra.c:zend_safe_address
Unexecuted instantiation: ir_save.c:zend_safe_address
Unexecuted instantiation: ir_sccp.c:zend_safe_address
Unexecuted instantiation: ir_strtab.c:zend_safe_address
Unexecuted instantiation: ir.c:zend_safe_address
Unexecuted instantiation: zend_jit_vm_helpers.c:zend_safe_address
Unexecuted instantiation: zend_jit.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.07k
{
181
1.07k
  size_t res;
182
1.07k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
1.07k
# define LP_SUFF "q"
188
1.07k
#endif
189
190
1.07k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
1.07k
    res = nmemb;
192
1.07k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
1.07k
      "adc $0,%1"
194
1.07k
      : "=&a"(res), "=&d" (m_overflow)
195
1.07k
      : "%0"(res),
196
1.07k
        "rm"(size)
197
1.07k
      : "cc");
198
1.07k
  } 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.07k
#undef LP_SUFF
217
1.07k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
1.07k
  *overflow = 0;
222
1.07k
  return res;
223
1.07k
}
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: uri_parser_rfc3986.c:zend_safe_address
Unexecuted instantiation: uri_parser_whatwg.c:zend_safe_address
Unexecuted instantiation: uri_parser_php_parse_url.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
98.6k
{
181
98.6k
  size_t res;
182
98.6k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
98.6k
# define LP_SUFF "q"
188
98.6k
#endif
189
190
98.6k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
98.6k
    res = nmemb;
192
98.6k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
98.6k
      "adc $0,%1"
194
98.6k
      : "=&a"(res), "=&d" (m_overflow)
195
98.6k
      : "%0"(res),
196
98.6k
        "rm"(size)
197
98.6k
      : "cc");
198
98.6k
  } 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
98.6k
#undef LP_SUFF
217
98.6k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
98.6k
  *overflow = 0;
222
98.6k
  return res;
223
98.6k
}
compact_literals.c:zend_safe_address
Line
Count
Source
180
98.6k
{
181
98.6k
  size_t res;
182
98.6k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
98.6k
# define LP_SUFF "q"
188
98.6k
#endif
189
190
98.6k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
98.6k
    res = nmemb;
192
98.6k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
98.6k
      "adc $0,%1"
194
98.6k
      : "=&a"(res), "=&d" (m_overflow)
195
98.6k
      : "%0"(res),
196
98.6k
        "rm"(size)
197
98.6k
      : "cc");
198
98.6k
  } 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
98.6k
#undef LP_SUFF
217
98.6k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
98.6k
  *overflow = 0;
222
98.6k
  return res;
223
98.6k
}
Unexecuted instantiation: compact_vars.c:zend_safe_address
dce.c:zend_safe_address
Line
Count
Source
180
286k
{
181
286k
  size_t res;
182
286k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
286k
# define LP_SUFF "q"
188
286k
#endif
189
190
286k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
286k
    res = nmemb;
192
286k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
286k
      "adc $0,%1"
194
286k
      : "=&a"(res), "=&d" (m_overflow)
195
286k
      : "%0"(res),
196
286k
        "rm"(size)
197
286k
      : "cc");
198
286k
  } 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
286k
#undef LP_SUFF
217
286k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
286k
  *overflow = 0;
222
286k
  return res;
223
286k
}
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
95.7k
{
181
95.7k
  size_t res;
182
95.7k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
95.7k
# define LP_SUFF "q"
188
95.7k
#endif
189
190
95.7k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
95.7k
    res = nmemb;
192
95.7k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
95.7k
      "adc $0,%1"
194
95.7k
      : "=&a"(res), "=&d" (m_overflow)
195
95.7k
      : "%0"(res),
196
95.7k
        "rm"(size)
197
95.7k
      : "cc");
198
95.7k
  } 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
95.7k
#undef LP_SUFF
217
95.7k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
95.7k
  *overflow = 0;
222
95.7k
  return res;
223
95.7k
}
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
71.5k
{
181
71.5k
  size_t res;
182
71.5k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
71.5k
# define LP_SUFF "q"
188
71.5k
#endif
189
190
71.5k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
71.5k
    res = nmemb;
192
71.5k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
71.5k
      "adc $0,%1"
194
71.5k
      : "=&a"(res), "=&d" (m_overflow)
195
71.5k
      : "%0"(res),
196
71.5k
        "rm"(size)
197
71.5k
      : "cc");
198
71.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
71.5k
#undef LP_SUFF
217
71.5k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
71.5k
  *overflow = 0;
222
71.5k
  return res;
223
71.5k
}
zend_call_graph.c:zend_safe_address
Line
Count
Source
180
260k
{
181
260k
  size_t res;
182
260k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
260k
# define LP_SUFF "q"
188
260k
#endif
189
190
260k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
260k
    res = nmemb;
192
260k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
260k
      "adc $0,%1"
194
260k
      : "=&a"(res), "=&d" (m_overflow)
195
260k
      : "%0"(res),
196
260k
        "rm"(size)
197
260k
      : "cc");
198
260k
  } 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
260k
#undef LP_SUFF
217
260k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
260k
  *overflow = 0;
222
260k
  return res;
223
260k
}
zend_cfg.c:zend_safe_address
Line
Count
Source
180
417k
{
181
417k
  size_t res;
182
417k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
417k
# define LP_SUFF "q"
188
417k
#endif
189
190
417k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
417k
    res = nmemb;
192
417k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
417k
      "adc $0,%1"
194
417k
      : "=&a"(res), "=&d" (m_overflow)
195
417k
      : "%0"(res),
196
417k
        "rm"(size)
197
417k
      : "cc");
198
417k
  } 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
417k
#undef LP_SUFF
217
417k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
417k
  *overflow = 0;
222
417k
  return res;
223
417k
}
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
71.5k
{
181
71.5k
  size_t res;
182
71.5k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
71.5k
# define LP_SUFF "q"
188
71.5k
#endif
189
190
71.5k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
71.5k
    res = nmemb;
192
71.5k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
71.5k
      "adc $0,%1"
194
71.5k
      : "=&a"(res), "=&d" (m_overflow)
195
71.5k
      : "%0"(res),
196
71.5k
        "rm"(size)
197
71.5k
      : "cc");
198
71.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
71.5k
#undef LP_SUFF
217
71.5k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
71.5k
  *overflow = 0;
222
71.5k
  return res;
223
71.5k
}
Unexecuted instantiation: zend_optimizer.c:zend_safe_address
zend_ssa.c:zend_safe_address
Line
Count
Source
180
352k
{
181
352k
  size_t res;
182
352k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
352k
# define LP_SUFF "q"
188
352k
#endif
189
190
352k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
352k
    res = nmemb;
192
352k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
352k
      "adc $0,%1"
194
352k
      : "=&a"(res), "=&d" (m_overflow)
195
352k
      : "%0"(res),
196
352k
        "rm"(size)
197
352k
      : "cc");
198
352k
  } 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
352k
#undef LP_SUFF
217
352k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
352k
  *overflow = 0;
222
352k
  return res;
223
352k
}
zend_alloc.c:zend_safe_address
Line
Count
Source
180
224M
{
181
224M
  size_t res;
182
224M
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
224M
# define LP_SUFF "q"
188
224M
#endif
189
190
224M
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
221M
    res = nmemb;
192
221M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
221M
      "adc $0,%1"
194
221M
      : "=&a"(res), "=&d" (m_overflow)
195
221M
      : "%0"(res),
196
221M
        "rm"(size)
197
221M
      : "cc");
198
221M
  } 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.80M
  } else {
206
3.80M
    res = nmemb;
207
3.80M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
3.80M
      "add %4,%0\n\t"
209
3.80M
      "adc $0,%1"
210
3.80M
      : "=&a"(res), "=&d" (m_overflow)
211
3.80M
      : "%0"(res),
212
3.80M
        "rm"(size),
213
3.80M
        "rm"(offset)
214
3.80M
      : "cc");
215
3.80M
  }
216
224M
#undef LP_SUFF
217
224M
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
224M
  *overflow = 0;
222
224M
  return res;
223
224M
}
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.74k
{
181
4.74k
  size_t res;
182
4.74k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
4.74k
# define LP_SUFF "q"
188
4.74k
#endif
189
190
4.74k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
4.74k
    res = nmemb;
192
4.74k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
4.74k
      "adc $0,%1"
194
4.74k
      : "=&a"(res), "=&d" (m_overflow)
195
4.74k
      : "%0"(res),
196
4.74k
        "rm"(size)
197
4.74k
      : "cc");
198
4.74k
  } 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.74k
#undef LP_SUFF
217
4.74k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
4.74k
  *overflow = 0;
222
4.74k
  return res;
223
4.74k
}
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
224M
{
338
224M
  bool overflow;
339
224M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
224M
  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
224M
  return ret;
346
224M
}
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
460
{
338
460
  bool overflow;
339
460
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
460
  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
460
  return ret;
346
460
}
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: shared_alloc_mmap.c:zend_safe_address_guarded
Unexecuted instantiation: shared_alloc_posix.c:zend_safe_address_guarded
Unexecuted instantiation: shared_alloc_shm.c:zend_safe_address_guarded
Unexecuted instantiation: zend_accelerator_api.c:zend_safe_address_guarded
Unexecuted instantiation: zend_accelerator_blacklist.c:zend_safe_address_guarded
Unexecuted instantiation: zend_accelerator_debug.c:zend_safe_address_guarded
Unexecuted instantiation: zend_accelerator_hash.c:zend_safe_address_guarded
Unexecuted instantiation: zend_accelerator_module.c:zend_safe_address_guarded
Unexecuted instantiation: zend_accelerator_util_funcs.c:zend_safe_address_guarded
Unexecuted instantiation: zend_file_cache.c:zend_safe_address_guarded
Unexecuted instantiation: zend_persist_calc.c:zend_safe_address_guarded
Unexecuted instantiation: zend_persist.c:zend_safe_address_guarded
Unexecuted instantiation: zend_shared_alloc.c:zend_safe_address_guarded
Unexecuted instantiation: ZendAccelerator.c:zend_safe_address_guarded
Unexecuted instantiation: ir_cfg.c:zend_safe_address_guarded
Unexecuted instantiation: ir_check.c:zend_safe_address_guarded
Unexecuted instantiation: ir_dump.c:zend_safe_address_guarded
Unexecuted instantiation: ir_emit.c:zend_safe_address_guarded
Unexecuted instantiation: ir_gcm.c:zend_safe_address_guarded
Unexecuted instantiation: ir_gdb.c:zend_safe_address_guarded
Unexecuted instantiation: ir_patch.c:zend_safe_address_guarded
Unexecuted instantiation: ir_perf.c:zend_safe_address_guarded
Unexecuted instantiation: ir_ra.c:zend_safe_address_guarded
Unexecuted instantiation: ir_save.c:zend_safe_address_guarded
Unexecuted instantiation: ir_sccp.c:zend_safe_address_guarded
Unexecuted instantiation: ir_strtab.c:zend_safe_address_guarded
Unexecuted instantiation: ir.c:zend_safe_address_guarded
Unexecuted instantiation: zend_jit_vm_helpers.c:zend_safe_address_guarded
Unexecuted instantiation: zend_jit.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: uri_parser_rfc3986.c:zend_safe_address_guarded
Unexecuted instantiation: uri_parser_whatwg.c:zend_safe_address_guarded
Unexecuted instantiation: uri_parser_php_parse_url.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
224M
{
338
224M
  bool overflow;
339
224M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
224M
  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
224M
  return ret;
346
224M
}
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.07k
{
351
1.07k
  bool overflow;
352
1.07k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
1.07k
  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.07k
  return ret;
359
1.07k
}
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: shared_alloc_mmap.c:zend_safe_addmult
Unexecuted instantiation: shared_alloc_posix.c:zend_safe_addmult
Unexecuted instantiation: shared_alloc_shm.c:zend_safe_addmult
Unexecuted instantiation: zend_accelerator_api.c:zend_safe_addmult
Unexecuted instantiation: zend_accelerator_blacklist.c:zend_safe_addmult
Unexecuted instantiation: zend_accelerator_debug.c:zend_safe_addmult
Unexecuted instantiation: zend_accelerator_hash.c:zend_safe_addmult
Unexecuted instantiation: zend_accelerator_module.c:zend_safe_addmult
Unexecuted instantiation: zend_accelerator_util_funcs.c:zend_safe_addmult
Unexecuted instantiation: zend_file_cache.c:zend_safe_addmult
Unexecuted instantiation: zend_persist_calc.c:zend_safe_addmult
Unexecuted instantiation: zend_persist.c:zend_safe_addmult
Unexecuted instantiation: zend_shared_alloc.c:zend_safe_addmult
Unexecuted instantiation: ZendAccelerator.c:zend_safe_addmult
Unexecuted instantiation: ir_cfg.c:zend_safe_addmult
Unexecuted instantiation: ir_check.c:zend_safe_addmult
Unexecuted instantiation: ir_dump.c:zend_safe_addmult
Unexecuted instantiation: ir_emit.c:zend_safe_addmult
Unexecuted instantiation: ir_gcm.c:zend_safe_addmult
Unexecuted instantiation: ir_gdb.c:zend_safe_addmult
Unexecuted instantiation: ir_patch.c:zend_safe_addmult
Unexecuted instantiation: ir_perf.c:zend_safe_addmult
Unexecuted instantiation: ir_ra.c:zend_safe_addmult
Unexecuted instantiation: ir_save.c:zend_safe_addmult
Unexecuted instantiation: ir_sccp.c:zend_safe_addmult
Unexecuted instantiation: ir_strtab.c:zend_safe_addmult
Unexecuted instantiation: ir.c:zend_safe_addmult
Unexecuted instantiation: zend_jit_vm_helpers.c:zend_safe_addmult
Unexecuted instantiation: zend_jit.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.07k
{
351
1.07k
  bool overflow;
352
1.07k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
1.07k
  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.07k
  return ret;
359
1.07k
}
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: uri_parser_rfc3986.c:zend_safe_addmult
Unexecuted instantiation: uri_parser_whatwg.c:zend_safe_addmult
Unexecuted instantiation: uri_parser_php_parse_url.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 */