Coverage Report

Created: 2025-12-31 07:28

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
92.4k
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
28
92.4k
  long __tmpvar;                          \
29
92.4k
  if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \
30
17.7k
    (dval) = (double) (a) * (double) (b);           \
31
17.7k
  }                                \
32
92.4k
  else (lval) = __tmpvar;                     \
33
92.4k
} 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
217M
{
181
217M
  size_t res;
182
217M
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
217M
# define LP_SUFF "q"
188
217M
#endif
189
190
217M
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
214M
    res = nmemb;
192
214M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
214M
      "adc $0,%1"
194
214M
      : "=&a"(res), "=&d" (m_overflow)
195
214M
      : "%0"(res),
196
214M
        "rm"(size)
197
214M
      : "cc");
198
214M
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
2
    res = size;
200
2
    __asm__ ("add %2, %0\n\t"
201
2
      "adc $0,%1"
202
2
      : "+r"(res), "+r" (m_overflow)
203
2
      : "rm"(offset)
204
2
      : "cc");
205
3.30M
  } else {
206
3.30M
    res = nmemb;
207
3.30M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
3.30M
      "add %4,%0\n\t"
209
3.30M
      "adc $0,%1"
210
3.30M
      : "=&a"(res), "=&d" (m_overflow)
211
3.30M
      : "%0"(res),
212
3.30M
        "rm"(size),
213
3.30M
        "rm"(offset)
214
3.30M
      : "cc");
215
3.30M
  }
216
217M
#undef LP_SUFF
217
217M
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
217M
  *overflow = 0;
222
217M
  return res;
223
217M
}
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
57
{
181
57
  size_t res;
182
57
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
57
# define LP_SUFF "q"
188
57
#endif
189
190
57
  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
57
  } else if (ZEND_CONST_COND(nmemb == 1, 0)) {
199
2
    res = size;
200
2
    __asm__ ("add %2, %0\n\t"
201
2
      "adc $0,%1"
202
2
      : "+r"(res), "+r" (m_overflow)
203
2
      : "rm"(offset)
204
2
      : "cc");
205
55
  } else {
206
55
    res = nmemb;
207
55
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
55
      "add %4,%0\n\t"
209
55
      "adc $0,%1"
210
55
      : "=&a"(res), "=&d" (m_overflow)
211
55
      : "%0"(res),
212
55
        "rm"(size),
213
55
        "rm"(offset)
214
55
      : "cc");
215
55
  }
216
57
#undef LP_SUFF
217
57
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
57
  *overflow = 0;
222
57
  return res;
223
57
}
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
677
{
181
677
  size_t res;
182
677
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
677
# define LP_SUFF "q"
188
677
#endif
189
190
677
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
677
    res = nmemb;
192
677
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
677
      "adc $0,%1"
194
677
      : "=&a"(res), "=&d" (m_overflow)
195
677
      : "%0"(res),
196
677
        "rm"(size)
197
677
      : "cc");
198
677
  } 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
677
#undef LP_SUFF
217
677
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
677
  *overflow = 0;
222
677
  return res;
223
677
}
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
17.0k
{
181
17.0k
  size_t res;
182
17.0k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
17.0k
# define LP_SUFF "q"
188
17.0k
#endif
189
190
17.0k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
17.0k
    res = nmemb;
192
17.0k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
17.0k
      "adc $0,%1"
194
17.0k
      : "=&a"(res), "=&d" (m_overflow)
195
17.0k
      : "%0"(res),
196
17.0k
        "rm"(size)
197
17.0k
      : "cc");
198
17.0k
  } 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
17.0k
#undef LP_SUFF
217
17.0k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
17.0k
  *overflow = 0;
222
17.0k
  return res;
223
17.0k
}
compact_literals.c:zend_safe_address
Line
Count
Source
180
17.0k
{
181
17.0k
  size_t res;
182
17.0k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
17.0k
# define LP_SUFF "q"
188
17.0k
#endif
189
190
17.0k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
17.0k
    res = nmemb;
192
17.0k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
17.0k
      "adc $0,%1"
194
17.0k
      : "=&a"(res), "=&d" (m_overflow)
195
17.0k
      : "%0"(res),
196
17.0k
        "rm"(size)
197
17.0k
      : "cc");
198
17.0k
  } 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
17.0k
#undef LP_SUFF
217
17.0k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
17.0k
  *overflow = 0;
222
17.0k
  return res;
223
17.0k
}
Unexecuted instantiation: compact_vars.c:zend_safe_address
dce.c:zend_safe_address
Line
Count
Source
180
27.1k
{
181
27.1k
  size_t res;
182
27.1k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
27.1k
# define LP_SUFF "q"
188
27.1k
#endif
189
190
27.1k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
27.1k
    res = nmemb;
192
27.1k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
27.1k
      "adc $0,%1"
194
27.1k
      : "=&a"(res), "=&d" (m_overflow)
195
27.1k
      : "%0"(res),
196
27.1k
        "rm"(size)
197
27.1k
      : "cc");
198
27.1k
  } 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
27.1k
#undef LP_SUFF
217
27.1k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
27.1k
  *overflow = 0;
222
27.1k
  return res;
223
27.1k
}
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
16.7k
{
181
16.7k
  size_t res;
182
16.7k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
16.7k
# define LP_SUFF "q"
188
16.7k
#endif
189
190
16.7k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
16.7k
    res = nmemb;
192
16.7k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
16.7k
      "adc $0,%1"
194
16.7k
      : "=&a"(res), "=&d" (m_overflow)
195
16.7k
      : "%0"(res),
196
16.7k
        "rm"(size)
197
16.7k
      : "cc");
198
16.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
16.7k
#undef LP_SUFF
217
16.7k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
16.7k
  *overflow = 0;
222
16.7k
  return res;
223
16.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
6.78k
{
181
6.78k
  size_t res;
182
6.78k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
6.78k
# define LP_SUFF "q"
188
6.78k
#endif
189
190
6.78k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
6.78k
    res = nmemb;
192
6.78k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
6.78k
      "adc $0,%1"
194
6.78k
      : "=&a"(res), "=&d" (m_overflow)
195
6.78k
      : "%0"(res),
196
6.78k
        "rm"(size)
197
6.78k
      : "cc");
198
6.78k
  } 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
6.78k
#undef LP_SUFF
217
6.78k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
6.78k
  *overflow = 0;
222
6.78k
  return res;
223
6.78k
}
zend_call_graph.c:zend_safe_address
Line
Count
Source
180
50.7k
{
181
50.7k
  size_t res;
182
50.7k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
50.7k
# define LP_SUFF "q"
188
50.7k
#endif
189
190
50.7k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
50.7k
    res = nmemb;
192
50.7k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
50.7k
      "adc $0,%1"
194
50.7k
      : "=&a"(res), "=&d" (m_overflow)
195
50.7k
      : "%0"(res),
196
50.7k
        "rm"(size)
197
50.7k
      : "cc");
198
50.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
50.7k
#undef LP_SUFF
217
50.7k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
50.7k
  *overflow = 0;
222
50.7k
  return res;
223
50.7k
}
zend_cfg.c:zend_safe_address
Line
Count
Source
180
55.4k
{
181
55.4k
  size_t res;
182
55.4k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
55.4k
# define LP_SUFF "q"
188
55.4k
#endif
189
190
55.4k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
55.4k
    res = nmemb;
192
55.4k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
55.4k
      "adc $0,%1"
194
55.4k
      : "=&a"(res), "=&d" (m_overflow)
195
55.4k
      : "%0"(res),
196
55.4k
        "rm"(size)
197
55.4k
      : "cc");
198
55.4k
  } 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
55.4k
#undef LP_SUFF
217
55.4k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
55.4k
  *overflow = 0;
222
55.4k
  return res;
223
55.4k
}
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
6.78k
{
181
6.78k
  size_t res;
182
6.78k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
6.78k
# define LP_SUFF "q"
188
6.78k
#endif
189
190
6.78k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
6.78k
    res = nmemb;
192
6.78k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
6.78k
      "adc $0,%1"
194
6.78k
      : "=&a"(res), "=&d" (m_overflow)
195
6.78k
      : "%0"(res),
196
6.78k
        "rm"(size)
197
6.78k
      : "cc");
198
6.78k
  } 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
6.78k
#undef LP_SUFF
217
6.78k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
6.78k
  *overflow = 0;
222
6.78k
  return res;
223
6.78k
}
Unexecuted instantiation: zend_optimizer.c:zend_safe_address
zend_ssa.c:zend_safe_address
Line
Count
Source
180
121k
{
181
121k
  size_t res;
182
121k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
121k
# define LP_SUFF "q"
188
121k
#endif
189
190
121k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
121k
    res = nmemb;
192
121k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
121k
      "adc $0,%1"
194
121k
      : "=&a"(res), "=&d" (m_overflow)
195
121k
      : "%0"(res),
196
121k
        "rm"(size)
197
121k
      : "cc");
198
121k
  } 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
121k
#undef LP_SUFF
217
121k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
121k
  *overflow = 0;
222
121k
  return res;
223
121k
}
zend_alloc.c:zend_safe_address
Line
Count
Source
180
217M
{
181
217M
  size_t res;
182
217M
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
217M
# define LP_SUFF "q"
188
217M
#endif
189
190
217M
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
214M
    res = nmemb;
192
214M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
214M
      "adc $0,%1"
194
214M
      : "=&a"(res), "=&d" (m_overflow)
195
214M
      : "%0"(res),
196
214M
        "rm"(size)
197
214M
      : "cc");
198
214M
  } 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.30M
  } else {
206
3.30M
    res = nmemb;
207
3.30M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
3.30M
      "add %4,%0\n\t"
209
3.30M
      "adc $0,%1"
210
3.30M
      : "=&a"(res), "=&d" (m_overflow)
211
3.30M
      : "%0"(res),
212
3.30M
        "rm"(size),
213
3.30M
        "rm"(offset)
214
3.30M
      : "cc");
215
3.30M
  }
216
217M
#undef LP_SUFF
217
217M
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
217M
  *overflow = 0;
222
217M
  return res;
223
217M
}
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
340
{
181
340
  size_t res;
182
340
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
340
# define LP_SUFF "q"
188
340
#endif
189
190
340
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
340
    res = nmemb;
192
340
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
340
      "adc $0,%1"
194
340
      : "=&a"(res), "=&d" (m_overflow)
195
340
      : "%0"(res),
196
340
        "rm"(size)
197
340
      : "cc");
198
340
  } 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
340
#undef LP_SUFF
217
340
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
340
  *overflow = 0;
222
340
  return res;
223
340
}
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
217M
{
338
217M
  bool overflow;
339
217M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
217M
  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
217M
  return ret;
346
217M
}
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
57
{
338
57
  bool overflow;
339
57
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
57
  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
57
  return ret;
346
57
}
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
217M
{
338
217M
  bool overflow;
339
217M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
217M
  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
217M
  return ret;
346
217M
}
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
677
{
351
677
  bool overflow;
352
677
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
677
  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
677
  return ret;
359
677
}
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
677
{
351
677
  bool overflow;
352
677
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
677
  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
677
  return ret;
359
677
}
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 */