Coverage Report

Created: 2025-12-14 06:05

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
1.50k
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
28
1.50k
  long __tmpvar;                          \
29
1.50k
  if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \
30
28
    (dval) = (double) (a) * (double) (b);           \
31
28
  }                                \
32
1.50k
  else (lval) = __tmpvar;                     \
33
1.50k
} 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
468k
{
181
468k
  size_t res;
182
468k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
468k
# define LP_SUFF "q"
188
468k
#endif
189
190
468k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
427k
    res = nmemb;
192
427k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
427k
      "adc $0,%1"
194
427k
      : "=&a"(res), "=&d" (m_overflow)
195
427k
      : "%0"(res),
196
427k
        "rm"(size)
197
427k
      : "cc");
198
427k
  } 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
41.0k
  } else {
206
41.0k
    res = nmemb;
207
41.0k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
41.0k
      "add %4,%0\n\t"
209
41.0k
      "adc $0,%1"
210
41.0k
      : "=&a"(res), "=&d" (m_overflow)
211
41.0k
      : "%0"(res),
212
41.0k
        "rm"(size),
213
41.0k
        "rm"(offset)
214
41.0k
      : "cc");
215
41.0k
  }
216
468k
#undef LP_SUFF
217
468k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
468k
  *overflow = 0;
222
468k
  return res;
223
468k
}
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
95
{
181
95
  size_t res;
182
95
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
95
# define LP_SUFF "q"
188
95
#endif
189
190
95
  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
95
  } 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
93
  } else {
206
93
    res = nmemb;
207
93
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
93
      "add %4,%0\n\t"
209
93
      "adc $0,%1"
210
93
      : "=&a"(res), "=&d" (m_overflow)
211
93
      : "%0"(res),
212
93
        "rm"(size),
213
93
        "rm"(offset)
214
93
      : "cc");
215
93
  }
216
95
#undef LP_SUFF
217
95
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
95
  *overflow = 0;
222
95
  return res;
223
95
}
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
35
{
181
35
  size_t res;
182
35
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
35
# define LP_SUFF "q"
188
35
#endif
189
190
35
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
35
    res = nmemb;
192
35
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
35
      "adc $0,%1"
194
35
      : "=&a"(res), "=&d" (m_overflow)
195
35
      : "%0"(res),
196
35
        "rm"(size)
197
35
      : "cc");
198
35
  } 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
35
#undef LP_SUFF
217
35
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
35
  *overflow = 0;
222
35
  return res;
223
35
}
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
1
{
181
1
  size_t res;
182
1
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
1
# define LP_SUFF "q"
188
1
#endif
189
190
1
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
1
    res = nmemb;
192
1
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
1
      "adc $0,%1"
194
1
      : "=&a"(res), "=&d" (m_overflow)
195
1
      : "%0"(res),
196
1
        "rm"(size)
197
1
      : "cc");
198
1
  } 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
#undef LP_SUFF
217
1
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
1
  *overflow = 0;
222
1
  return res;
223
1
}
compact_literals.c:zend_safe_address
Line
Count
Source
180
1
{
181
1
  size_t res;
182
1
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
1
# define LP_SUFF "q"
188
1
#endif
189
190
1
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
1
    res = nmemb;
192
1
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
1
      "adc $0,%1"
194
1
      : "=&a"(res), "=&d" (m_overflow)
195
1
      : "%0"(res),
196
1
        "rm"(size)
197
1
      : "cc");
198
1
  } 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
#undef LP_SUFF
217
1
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
1
  *overflow = 0;
222
1
  return res;
223
1
}
Unexecuted instantiation: compact_vars.c:zend_safe_address
dce.c:zend_safe_address
Line
Count
Source
180
4
{
181
4
  size_t res;
182
4
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
4
# define LP_SUFF "q"
188
4
#endif
189
190
4
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
4
    res = nmemb;
192
4
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
4
      "adc $0,%1"
194
4
      : "=&a"(res), "=&d" (m_overflow)
195
4
      : "%0"(res),
196
4
        "rm"(size)
197
4
      : "cc");
198
4
  } 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
#undef LP_SUFF
217
4
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
4
  *overflow = 0;
222
4
  return res;
223
4
}
Unexecuted instantiation: dfa_pass.c:zend_safe_address
Unexecuted instantiation: escape_analysis.c:zend_safe_address
Unexecuted instantiation: nop_removal.c:zend_safe_address
Unexecuted instantiation: optimize_func_calls.c:zend_safe_address
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
1
{
181
1
  size_t res;
182
1
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
1
# define LP_SUFF "q"
188
1
#endif
189
190
1
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
1
    res = nmemb;
192
1
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
1
      "adc $0,%1"
194
1
      : "=&a"(res), "=&d" (m_overflow)
195
1
      : "%0"(res),
196
1
        "rm"(size)
197
1
      : "cc");
198
1
  } 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
#undef LP_SUFF
217
1
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
1
  *overflow = 0;
222
1
  return res;
223
1
}
zend_call_graph.c:zend_safe_address
Line
Count
Source
180
2
{
181
2
  size_t res;
182
2
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
2
# define LP_SUFF "q"
188
2
#endif
189
190
2
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
2
    res = nmemb;
192
2
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
2
      "adc $0,%1"
194
2
      : "=&a"(res), "=&d" (m_overflow)
195
2
      : "%0"(res),
196
2
        "rm"(size)
197
2
      : "cc");
198
2
  } 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
2
#undef LP_SUFF
217
2
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
2
  *overflow = 0;
222
2
  return res;
223
2
}
zend_cfg.c:zend_safe_address
Line
Count
Source
180
5
{
181
5
  size_t res;
182
5
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
5
# define LP_SUFF "q"
188
5
#endif
189
190
5
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
5
    res = nmemb;
192
5
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
5
      "adc $0,%1"
194
5
      : "=&a"(res), "=&d" (m_overflow)
195
5
      : "%0"(res),
196
5
        "rm"(size)
197
5
      : "cc");
198
5
  } 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
5
#undef LP_SUFF
217
5
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
5
  *overflow = 0;
222
5
  return res;
223
5
}
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
1
{
181
1
  size_t res;
182
1
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
1
# define LP_SUFF "q"
188
1
#endif
189
190
1
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
1
    res = nmemb;
192
1
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
1
      "adc $0,%1"
194
1
      : "=&a"(res), "=&d" (m_overflow)
195
1
      : "%0"(res),
196
1
        "rm"(size)
197
1
      : "cc");
198
1
  } 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
#undef LP_SUFF
217
1
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
1
  *overflow = 0;
222
1
  return res;
223
1
}
Unexecuted instantiation: zend_optimizer.c:zend_safe_address
zend_ssa.c:zend_safe_address
Line
Count
Source
180
3
{
181
3
  size_t res;
182
3
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
3
# define LP_SUFF "q"
188
3
#endif
189
190
3
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
3
    res = nmemb;
192
3
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
3
      "adc $0,%1"
194
3
      : "=&a"(res), "=&d" (m_overflow)
195
3
      : "%0"(res),
196
3
        "rm"(size)
197
3
      : "cc");
198
3
  } 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
3
#undef LP_SUFF
217
3
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
3
  *overflow = 0;
222
3
  return res;
223
3
}
zend_alloc.c:zend_safe_address
Line
Count
Source
180
468k
{
181
468k
  size_t res;
182
468k
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
468k
# define LP_SUFF "q"
188
468k
#endif
189
190
468k
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
427k
    res = nmemb;
192
427k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
427k
      "adc $0,%1"
194
427k
      : "=&a"(res), "=&d" (m_overflow)
195
427k
      : "%0"(res),
196
427k
        "rm"(size)
197
427k
      : "cc");
198
427k
  } 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
40.9k
  } else {
206
40.9k
    res = nmemb;
207
40.9k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
208
40.9k
      "add %4,%0\n\t"
209
40.9k
      "adc $0,%1"
210
40.9k
      : "=&a"(res), "=&d" (m_overflow)
211
40.9k
      : "%0"(res),
212
40.9k
        "rm"(size),
213
40.9k
        "rm"(offset)
214
40.9k
      : "cc");
215
40.9k
  }
216
468k
#undef LP_SUFF
217
468k
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
468k
  *overflow = 0;
222
468k
  return res;
223
468k
}
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
350
{
181
350
  size_t res;
182
350
  zend_ulong m_overflow = 0;
183
184
#ifdef __ILP32__ /* x32 */
185
# define LP_SUFF "l"
186
#else /* amd64 */
187
350
# define LP_SUFF "q"
188
350
#endif
189
190
350
  if (ZEND_CONST_COND(offset == 0, 0)) {
191
350
    res = nmemb;
192
350
    __asm__ ("mul" LP_SUFF  " %3\n\t"
193
350
      "adc $0,%1"
194
350
      : "=&a"(res), "=&d" (m_overflow)
195
350
      : "%0"(res),
196
350
        "rm"(size)
197
350
      : "cc");
198
350
  } 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
350
#undef LP_SUFF
217
350
  if (UNEXPECTED(m_overflow)) {
218
0
    *overflow = 1;
219
0
    return 0;
220
0
  }
221
350
  *overflow = 0;
222
350
  return res;
223
350
}
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-execute.c:zend_safe_address
Unexecuted instantiation: fuzzer-sapi.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
468k
{
338
468k
  bool overflow;
339
468k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
468k
  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
468k
  return ret;
346
468k
}
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
95
{
338
95
  bool overflow;
339
95
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
95
  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
95
  return ret;
346
95
}
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
468k
{
338
468k
  bool overflow;
339
468k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
340
341
468k
  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
468k
  return ret;
346
468k
}
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-execute.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-sapi.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
35
{
351
35
  bool overflow;
352
35
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
35
  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
35
  return ret;
359
35
}
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
35
{
351
35
  bool overflow;
352
35
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
353
354
35
  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
35
  return ret;
359
35
}
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-execute.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_addmult
360
361
#endif /* ZEND_MULTIPLY_H */