Coverage Report

Created: 2025-07-23 06:33

/src/php-src/Zend/Optimizer/zend_inference.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
   +----------------------------------------------------------------------+
3
   | Zend Engine, e-SSA based Type & Range Inference                      |
4
   +----------------------------------------------------------------------+
5
   | Copyright (c) The PHP Group                                          |
6
   +----------------------------------------------------------------------+
7
   | This source file is subject to version 3.01 of the PHP 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
   | https://www.php.net/license/3_01.txt                                 |
11
   | If you did not receive a copy of the PHP license and are unable to   |
12
   | obtain it through the world-wide-web, please send a note to          |
13
   | license@php.net so we can mail you a copy immediately.               |
14
   +----------------------------------------------------------------------+
15
   | Authors: Dmitry Stogov <dmitry@php.net>                              |
16
   +----------------------------------------------------------------------+
17
*/
18
19
#ifndef ZEND_INFERENCE_H
20
#define ZEND_INFERENCE_H
21
22
#include "zend_optimizer.h"
23
#include "zend_ssa.h"
24
#include "zend_bitset.h"
25
26
/* Bitmask for type inference (zend_ssa_var_info.type) */
27
#include "zend_type_info.h"
28
29
#include <stdint.h>
30
31
0
#define MAY_BE_PACKED_GUARD         (1<<27) /* needs packed array guard */
32
#define MAY_BE_CLASS_GUARD          (1<<27) /* needs class guard */
33
1.33M
#define MAY_BE_GUARD                (1<<28) /* needs type guard */
34
35
#define MAY_HAVE_DTOR \
36
4.35k
  (MAY_BE_OBJECT|MAY_BE_RESOURCE \
37
4.35k
  |MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE)
38
39
#define DEFINE_SSA_OP_HAS_RANGE(opN) \
40
  static zend_always_inline bool _ssa_##opN##_has_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
41
319k
  { \
42
319k
    if (opline->opN##_type == IS_CONST) { \
43
42.1k
      zval *zv = CRT_CONSTANT(opline->opN); \
44
42.1k
      return (Z_TYPE_P(zv) == IS_LONG); \
45
277k
    } else { \
46
277k
      return (opline->opN##_type != IS_UNUSED && \
47
277k
            ssa->var_info && \
48
277k
            ssa_op->opN##_use >= 0 && \
49
277k
          ssa->var_info[ssa_op->opN##_use].has_range); \
50
277k
    } \
51
319k
    return 0; \
52
319k
  } \
Unexecuted instantiation: dce.c:_ssa_op1_has_range
Unexecuted instantiation: dce.c:_ssa_op2_has_range
Unexecuted instantiation: dfa_pass.c:_ssa_op1_has_range
Unexecuted instantiation: dfa_pass.c:_ssa_op2_has_range
Unexecuted instantiation: escape_analysis.c:_ssa_op1_has_range
Unexecuted instantiation: escape_analysis.c:_ssa_op2_has_range
Unexecuted instantiation: sccp.c:_ssa_op1_has_range
Unexecuted instantiation: sccp.c:_ssa_op2_has_range
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_has_range
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_has_range
Unexecuted instantiation: zend_dump.c:_ssa_op1_has_range
Unexecuted instantiation: zend_dump.c:_ssa_op2_has_range
Unexecuted instantiation: zend_func_info.c:_ssa_op1_has_range
Unexecuted instantiation: zend_func_info.c:_ssa_op2_has_range
zend_inference.c:_ssa_op1_has_range
Line
Count
Source
41
178k
  { \
42
178k
    if (opline->opN##_type == IS_CONST) { \
43
18.9k
      zval *zv = CRT_CONSTANT(opline->opN); \
44
18.9k
      return (Z_TYPE_P(zv) == IS_LONG); \
45
159k
    } else { \
46
159k
      return (opline->opN##_type != IS_UNUSED && \
47
159k
            ssa->var_info && \
48
159k
            ssa_op->opN##_use >= 0 && \
49
159k
          ssa->var_info[ssa_op->opN##_use].has_range); \
50
159k
    } \
51
178k
    return 0; \
52
178k
  } \
zend_inference.c:_ssa_op2_has_range
Line
Count
Source
41
140k
  { \
42
140k
    if (opline->opN##_type == IS_CONST) { \
43
23.1k
      zval *zv = CRT_CONSTANT(opline->opN); \
44
23.1k
      return (Z_TYPE_P(zv) == IS_LONG); \
45
117k
    } else { \
46
117k
      return (opline->opN##_type != IS_UNUSED && \
47
117k
            ssa->var_info && \
48
117k
            ssa_op->opN##_use >= 0 && \
49
117k
          ssa->var_info[ssa_op->opN##_use].has_range); \
50
117k
    } \
51
140k
    return 0; \
52
140k
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_has_range
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_has_range
Unexecuted instantiation: zend_ssa.c:_ssa_op1_has_range
Unexecuted instantiation: zend_ssa.c:_ssa_op2_has_range
53
54
#define DEFINE_SSA_OP_MIN_RANGE(opN) \
55
  static zend_always_inline zend_long _ssa_##opN##_min_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
56
240k
  { \
57
240k
    if (opline->opN##_type == IS_CONST) { \
58
20.3k
      zval *zv = CRT_CONSTANT(opline->opN); \
59
20.3k
      if (Z_TYPE_P(zv) == IS_LONG) { \
60
20.3k
        return Z_LVAL_P(zv); \
61
20.3k
      } \
62
220k
    } else if (opline->opN##_type != IS_UNUSED && \
63
220k
        ssa->var_info && \
64
220k
        ssa_op->opN##_use >= 0 && \
65
220k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
66
220k
      return ssa->var_info[ssa_op->opN##_use].range.min; \
67
220k
    } \
68
240k
    return ZEND_LONG_MIN; \
69
240k
  } \
Unexecuted instantiation: dce.c:_ssa_op1_min_range
Unexecuted instantiation: dce.c:_ssa_op2_min_range
Unexecuted instantiation: dfa_pass.c:_ssa_op1_min_range
Unexecuted instantiation: dfa_pass.c:_ssa_op2_min_range
Unexecuted instantiation: escape_analysis.c:_ssa_op1_min_range
Unexecuted instantiation: escape_analysis.c:_ssa_op2_min_range
Unexecuted instantiation: sccp.c:_ssa_op1_min_range
Unexecuted instantiation: sccp.c:_ssa_op2_min_range
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_min_range
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_min_range
Unexecuted instantiation: zend_dump.c:_ssa_op1_min_range
Unexecuted instantiation: zend_dump.c:_ssa_op2_min_range
Unexecuted instantiation: zend_func_info.c:_ssa_op1_min_range
Unexecuted instantiation: zend_func_info.c:_ssa_op2_min_range
zend_inference.c:_ssa_op1_min_range
Line
Count
Source
56
129k
  { \
57
129k
    if (opline->opN##_type == IS_CONST) { \
58
5.01k
      zval *zv = CRT_CONSTANT(opline->opN); \
59
5.01k
      if (Z_TYPE_P(zv) == IS_LONG) { \
60
5.01k
        return Z_LVAL_P(zv); \
61
5.01k
      } \
62
124k
    } else if (opline->opN##_type != IS_UNUSED && \
63
124k
        ssa->var_info && \
64
124k
        ssa_op->opN##_use >= 0 && \
65
124k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
66
124k
      return ssa->var_info[ssa_op->opN##_use].range.min; \
67
124k
    } \
68
129k
    return ZEND_LONG_MIN; \
69
129k
  } \
zend_inference.c:_ssa_op2_min_range
Line
Count
Source
56
111k
  { \
57
111k
    if (opline->opN##_type == IS_CONST) { \
58
15.3k
      zval *zv = CRT_CONSTANT(opline->opN); \
59
15.3k
      if (Z_TYPE_P(zv) == IS_LONG) { \
60
15.3k
        return Z_LVAL_P(zv); \
61
15.3k
      } \
62
95.8k
    } else if (opline->opN##_type != IS_UNUSED && \
63
95.8k
        ssa->var_info && \
64
95.8k
        ssa_op->opN##_use >= 0 && \
65
95.8k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
66
95.8k
      return ssa->var_info[ssa_op->opN##_use].range.min; \
67
95.8k
    } \
68
111k
    return ZEND_LONG_MIN; \
69
111k
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_min_range
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_min_range
Unexecuted instantiation: zend_ssa.c:_ssa_op1_min_range
Unexecuted instantiation: zend_ssa.c:_ssa_op2_min_range
70
71
#define DEFINE_SSA_OP_MAX_RANGE(opN) \
72
  static zend_always_inline zend_long _ssa_##opN##_max_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
73
240k
  { \
74
240k
    if (opline->opN##_type == IS_CONST) { \
75
19.6k
      zval *zv = CRT_CONSTANT(opline->opN); \
76
19.6k
      if (Z_TYPE_P(zv) == IS_LONG) { \
77
19.6k
        return Z_LVAL_P(zv); \
78
19.6k
      } \
79
220k
    } else if (opline->opN##_type != IS_UNUSED && \
80
220k
        ssa->var_info && \
81
220k
        ssa_op->opN##_use >= 0 && \
82
220k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
83
220k
      return ssa->var_info[ssa_op->opN##_use].range.max; \
84
220k
    } \
85
240k
    return ZEND_LONG_MAX; \
86
240k
  } \
Unexecuted instantiation: dce.c:_ssa_op1_max_range
Unexecuted instantiation: dce.c:_ssa_op2_max_range
Unexecuted instantiation: dfa_pass.c:_ssa_op1_max_range
Unexecuted instantiation: dfa_pass.c:_ssa_op2_max_range
Unexecuted instantiation: escape_analysis.c:_ssa_op1_max_range
Unexecuted instantiation: escape_analysis.c:_ssa_op2_max_range
Unexecuted instantiation: sccp.c:_ssa_op1_max_range
Unexecuted instantiation: sccp.c:_ssa_op2_max_range
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_max_range
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_max_range
Unexecuted instantiation: zend_dump.c:_ssa_op1_max_range
Unexecuted instantiation: zend_dump.c:_ssa_op2_max_range
Unexecuted instantiation: zend_func_info.c:_ssa_op1_max_range
Unexecuted instantiation: zend_func_info.c:_ssa_op2_max_range
zend_inference.c:_ssa_op1_max_range
Line
Count
Source
73
129k
  { \
74
129k
    if (opline->opN##_type == IS_CONST) { \
75
5.01k
      zval *zv = CRT_CONSTANT(opline->opN); \
76
5.01k
      if (Z_TYPE_P(zv) == IS_LONG) { \
77
5.01k
        return Z_LVAL_P(zv); \
78
5.01k
      } \
79
124k
    } else if (opline->opN##_type != IS_UNUSED && \
80
124k
        ssa->var_info && \
81
124k
        ssa_op->opN##_use >= 0 && \
82
124k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
83
124k
      return ssa->var_info[ssa_op->opN##_use].range.max; \
84
124k
    } \
85
129k
    return ZEND_LONG_MAX; \
86
129k
  } \
zend_inference.c:_ssa_op2_max_range
Line
Count
Source
73
110k
  { \
74
110k
    if (opline->opN##_type == IS_CONST) { \
75
14.6k
      zval *zv = CRT_CONSTANT(opline->opN); \
76
14.6k
      if (Z_TYPE_P(zv) == IS_LONG) { \
77
14.6k
        return Z_LVAL_P(zv); \
78
14.6k
      } \
79
95.7k
    } else if (opline->opN##_type != IS_UNUSED && \
80
95.7k
        ssa->var_info && \
81
95.7k
        ssa_op->opN##_use >= 0 && \
82
95.7k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
83
95.7k
      return ssa->var_info[ssa_op->opN##_use].range.max; \
84
95.7k
    } \
85
110k
    return ZEND_LONG_MAX; \
86
110k
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_max_range
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_max_range
Unexecuted instantiation: zend_ssa.c:_ssa_op1_max_range
Unexecuted instantiation: zend_ssa.c:_ssa_op2_max_range
87
88
#define DEFINE_SSA_OP_RANGE_UNDERFLOW(opN) \
89
  static zend_always_inline char _ssa_##opN##_range_underflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
90
206k
  { \
91
206k
    if (opline->opN##_type == IS_CONST) { \
92
14.1k
      zval *zv = CRT_CONSTANT(opline->opN); \
93
14.1k
      if (Z_TYPE_P(zv) == IS_LONG) { \
94
14.1k
        return 0; \
95
14.1k
      } \
96
192k
    } else if (opline->opN##_type != IS_UNUSED && \
97
192k
        ssa->var_info && \
98
192k
        ssa_op->opN##_use >= 0 && \
99
192k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
100
192k
      return ssa->var_info[ssa_op->opN##_use].range.underflow; \
101
192k
    } \
102
206k
    return 1; \
103
206k
  } \
Unexecuted instantiation: dce.c:_ssa_op1_range_underflow
Unexecuted instantiation: dce.c:_ssa_op2_range_underflow
Unexecuted instantiation: dfa_pass.c:_ssa_op1_range_underflow
Unexecuted instantiation: dfa_pass.c:_ssa_op2_range_underflow
Unexecuted instantiation: escape_analysis.c:_ssa_op1_range_underflow
Unexecuted instantiation: escape_analysis.c:_ssa_op2_range_underflow
Unexecuted instantiation: sccp.c:_ssa_op1_range_underflow
Unexecuted instantiation: sccp.c:_ssa_op2_range_underflow
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_range_underflow
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_range_underflow
Unexecuted instantiation: zend_dump.c:_ssa_op1_range_underflow
Unexecuted instantiation: zend_dump.c:_ssa_op2_range_underflow
Unexecuted instantiation: zend_func_info.c:_ssa_op1_range_underflow
Unexecuted instantiation: zend_func_info.c:_ssa_op2_range_underflow
zend_inference.c:_ssa_op1_range_underflow
Line
Count
Source
90
143k
  { \
91
143k
    if (opline->opN##_type == IS_CONST) { \
92
5.28k
      zval *zv = CRT_CONSTANT(opline->opN); \
93
5.28k
      if (Z_TYPE_P(zv) == IS_LONG) { \
94
5.28k
        return 0; \
95
5.28k
      } \
96
137k
    } else if (opline->opN##_type != IS_UNUSED && \
97
137k
        ssa->var_info && \
98
137k
        ssa_op->opN##_use >= 0 && \
99
137k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
100
137k
      return ssa->var_info[ssa_op->opN##_use].range.underflow; \
101
137k
    } \
102
143k
    return 1; \
103
143k
  } \
zend_inference.c:_ssa_op2_range_underflow
Line
Count
Source
90
63.2k
  { \
91
63.2k
    if (opline->opN##_type == IS_CONST) { \
92
8.90k
      zval *zv = CRT_CONSTANT(opline->opN); \
93
8.90k
      if (Z_TYPE_P(zv) == IS_LONG) { \
94
8.90k
        return 0; \
95
8.90k
      } \
96
54.3k
    } else if (opline->opN##_type != IS_UNUSED && \
97
54.3k
        ssa->var_info && \
98
54.3k
        ssa_op->opN##_use >= 0 && \
99
54.3k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
100
54.3k
      return ssa->var_info[ssa_op->opN##_use].range.underflow; \
101
54.3k
    } \
102
63.2k
    return 1; \
103
63.2k
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_range_underflow
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_range_underflow
Unexecuted instantiation: zend_ssa.c:_ssa_op1_range_underflow
Unexecuted instantiation: zend_ssa.c:_ssa_op2_range_underflow
104
105
#define DEFINE_SSA_OP_RANGE_OVERFLOW(opN) \
106
  static zend_always_inline char _ssa_##opN##_range_overflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
107
170k
  { \
108
170k
    if (opline->opN##_type == IS_CONST) { \
109
13.7k
      zval *zv = CRT_CONSTANT(opline->opN); \
110
13.7k
      if (Z_TYPE_P(zv) == IS_LONG) { \
111
13.7k
        return 0; \
112
13.7k
      } \
113
157k
    } else if (opline->opN##_type != IS_UNUSED && \
114
157k
        ssa->var_info && \
115
157k
        ssa_op->opN##_use >= 0 && \
116
157k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
117
157k
      return ssa->var_info[ssa_op->opN##_use].range.overflow; \
118
157k
    } \
119
170k
    return 1; \
120
170k
  } \
Unexecuted instantiation: dce.c:_ssa_op1_range_overflow
Unexecuted instantiation: dce.c:_ssa_op2_range_overflow
Unexecuted instantiation: dfa_pass.c:_ssa_op1_range_overflow
Unexecuted instantiation: dfa_pass.c:_ssa_op2_range_overflow
Unexecuted instantiation: escape_analysis.c:_ssa_op1_range_overflow
Unexecuted instantiation: escape_analysis.c:_ssa_op2_range_overflow
Unexecuted instantiation: sccp.c:_ssa_op1_range_overflow
Unexecuted instantiation: sccp.c:_ssa_op2_range_overflow
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_range_overflow
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_range_overflow
Unexecuted instantiation: zend_dump.c:_ssa_op1_range_overflow
Unexecuted instantiation: zend_dump.c:_ssa_op2_range_overflow
Unexecuted instantiation: zend_func_info.c:_ssa_op1_range_overflow
Unexecuted instantiation: zend_func_info.c:_ssa_op2_range_overflow
zend_inference.c:_ssa_op1_range_overflow
Line
Count
Source
107
109k
  { \
108
109k
    if (opline->opN##_type == IS_CONST) { \
109
4.88k
      zval *zv = CRT_CONSTANT(opline->opN); \
110
4.88k
      if (Z_TYPE_P(zv) == IS_LONG) { \
111
4.88k
        return 0; \
112
4.88k
      } \
113
105k
    } else if (opline->opN##_type != IS_UNUSED && \
114
105k
        ssa->var_info && \
115
105k
        ssa_op->opN##_use >= 0 && \
116
105k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
117
105k
      return ssa->var_info[ssa_op->opN##_use].range.overflow; \
118
105k
    } \
119
109k
    return 1; \
120
109k
  } \
zend_inference.c:_ssa_op2_range_overflow
Line
Count
Source
107
61.0k
  { \
108
61.0k
    if (opline->opN##_type == IS_CONST) { \
109
8.89k
      zval *zv = CRT_CONSTANT(opline->opN); \
110
8.89k
      if (Z_TYPE_P(zv) == IS_LONG) { \
111
8.89k
        return 0; \
112
8.89k
      } \
113
52.1k
    } else if (opline->opN##_type != IS_UNUSED && \
114
52.1k
        ssa->var_info && \
115
52.1k
        ssa_op->opN##_use >= 0 && \
116
52.1k
        ssa->var_info[ssa_op->opN##_use].has_range) { \
117
52.1k
      return ssa->var_info[ssa_op->opN##_use].range.overflow; \
118
52.1k
    } \
119
61.0k
    return 1; \
120
61.0k
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_range_overflow
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_range_overflow
Unexecuted instantiation: zend_ssa.c:_ssa_op1_range_overflow
Unexecuted instantiation: zend_ssa.c:_ssa_op2_range_overflow
121
122
DEFINE_SSA_OP_HAS_RANGE(op1)
123
DEFINE_SSA_OP_MIN_RANGE(op1)
124
DEFINE_SSA_OP_MAX_RANGE(op1)
125
DEFINE_SSA_OP_RANGE_UNDERFLOW(op1)
126
DEFINE_SSA_OP_RANGE_OVERFLOW(op1)
127
DEFINE_SSA_OP_HAS_RANGE(op2)
128
DEFINE_SSA_OP_MIN_RANGE(op2)
129
DEFINE_SSA_OP_MAX_RANGE(op2)
130
DEFINE_SSA_OP_RANGE_UNDERFLOW(op2)
131
DEFINE_SSA_OP_RANGE_OVERFLOW(op2)
132
133
278k
#define OP1_HAS_RANGE()       (_ssa_op1_has_range (op_array, ssa, opline, ssa_op))
134
129k
#define OP1_MIN_RANGE()       (_ssa_op1_min_range (op_array, ssa, opline, ssa_op))
135
129k
#define OP1_MAX_RANGE()       (_ssa_op1_max_range (op_array, ssa, opline, ssa_op))
136
239k
#define OP1_RANGE_UNDERFLOW() (_ssa_op1_range_underflow (op_array, ssa, opline, ssa_op))
137
183k
#define OP1_RANGE_OVERFLOW()  (_ssa_op1_range_overflow (op_array, ssa, opline, ssa_op))
138
141k
#define OP2_HAS_RANGE()       (_ssa_op2_has_range (op_array, ssa, opline, ssa_op))
139
111k
#define OP2_MIN_RANGE()       (_ssa_op2_min_range (op_array, ssa, opline, ssa_op))
140
110k
#define OP2_MAX_RANGE()       (_ssa_op2_max_range (op_array, ssa, opline, ssa_op))
141
137k
#define OP2_RANGE_UNDERFLOW() (_ssa_op2_range_underflow (op_array, ssa, opline, ssa_op))
142
120k
#define OP2_RANGE_OVERFLOW()  (_ssa_op2_range_overflow (op_array, ssa, opline, ssa_op))
143
144
BEGIN_EXTERN_C()
145
ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv);
146
END_EXTERN_C()
147
148
1.13M
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
149
1.13M
  if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
150
1.71k
    return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
151
1.12M
  } else if (Z_TYPE_P(zv) == IS_ARRAY) {
152
15.1k
    return zend_array_type_info(zv);
153
1.11M
  } else {
154
1.11M
    uint32_t tmp = (1 << Z_TYPE_P(zv));
155
156
1.11M
    if (Z_REFCOUNTED_P(zv)) {
157
135k
      tmp |= MAY_BE_RC1 | MAY_BE_RCN;
158
977k
    } else if (Z_TYPE_P(zv) == IS_STRING) {
159
681k
      tmp |= MAY_BE_RCN;
160
681k
    }
161
1.11M
    return tmp;
162
1.11M
  }
163
1.13M
}
dce.c:_const_op_type
Line
Count
Source
148
2
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
149
2
  if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
150
0
    return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
151
2
  } else if (Z_TYPE_P(zv) == IS_ARRAY) {
152
2
    return zend_array_type_info(zv);
153
2
  } else {
154
0
    uint32_t tmp = (1 << Z_TYPE_P(zv));
155
156
0
    if (Z_REFCOUNTED_P(zv)) {
157
0
      tmp |= MAY_BE_RC1 | MAY_BE_RCN;
158
0
    } else if (Z_TYPE_P(zv) == IS_STRING) {
159
0
      tmp |= MAY_BE_RCN;
160
0
    }
161
0
    return tmp;
162
0
  }
163
2
}
dfa_pass.c:_const_op_type
Line
Count
Source
148
3.33k
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
149
3.33k
  if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
150
0
    return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
151
3.33k
  } else if (Z_TYPE_P(zv) == IS_ARRAY) {
152
0
    return zend_array_type_info(zv);
153
3.33k
  } else {
154
3.33k
    uint32_t tmp = (1 << Z_TYPE_P(zv));
155
156
3.33k
    if (Z_REFCOUNTED_P(zv)) {
157
747
      tmp |= MAY_BE_RC1 | MAY_BE_RCN;
158
2.59k
    } else if (Z_TYPE_P(zv) == IS_STRING) {
159
2.59k
      tmp |= MAY_BE_RCN;
160
2.59k
    }
161
3.33k
    return tmp;
162
3.33k
  }
163
3.33k
}
Unexecuted instantiation: escape_analysis.c:_const_op_type
Unexecuted instantiation: sccp.c:_const_op_type
Unexecuted instantiation: zend_call_graph.c:_const_op_type
Unexecuted instantiation: zend_dump.c:_const_op_type
zend_func_info.c:_const_op_type
Line
Count
Source
148
490
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
149
490
  if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
150
0
    return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
151
490
  } else if (Z_TYPE_P(zv) == IS_ARRAY) {
152
0
    return zend_array_type_info(zv);
153
490
  } else {
154
490
    uint32_t tmp = (1 << Z_TYPE_P(zv));
155
156
490
    if (Z_REFCOUNTED_P(zv)) {
157
0
      tmp |= MAY_BE_RC1 | MAY_BE_RCN;
158
490
    } else if (Z_TYPE_P(zv) == IS_STRING) {
159
28
      tmp |= MAY_BE_RCN;
160
28
    }
161
490
    return tmp;
162
490
  }
163
490
}
zend_inference.c:_const_op_type
Line
Count
Source
148
553k
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
149
553k
  if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
150
1.02k
    return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
151
552k
  } else if (Z_TYPE_P(zv) == IS_ARRAY) {
152
7.18k
    return zend_array_type_info(zv);
153
545k
  } else {
154
545k
    uint32_t tmp = (1 << Z_TYPE_P(zv));
155
156
545k
    if (Z_REFCOUNTED_P(zv)) {
157
72.6k
      tmp |= MAY_BE_RC1 | MAY_BE_RCN;
158
472k
    } else if (Z_TYPE_P(zv) == IS_STRING) {
159
322k
      tmp |= MAY_BE_RCN;
160
322k
    }
161
545k
    return tmp;
162
545k
  }
163
553k
}
zend_optimizer.c:_const_op_type
Line
Count
Source
148
573k
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
149
573k
  if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
150
682
    return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
151
572k
  } else if (Z_TYPE_P(zv) == IS_ARRAY) {
152
7.97k
    return zend_array_type_info(zv);
153
564k
  } else {
154
564k
    uint32_t tmp = (1 << Z_TYPE_P(zv));
155
156
564k
    if (Z_REFCOUNTED_P(zv)) {
157
62.4k
      tmp |= MAY_BE_RC1 | MAY_BE_RCN;
158
501k
    } else if (Z_TYPE_P(zv) == IS_STRING) {
159
356k
      tmp |= MAY_BE_RCN;
160
356k
    }
161
564k
    return tmp;
162
564k
  }
163
573k
}
Unexecuted instantiation: zend_ssa.c:_const_op_type
164
165
static zend_always_inline uint32_t get_ssa_var_info(const zend_ssa *ssa, int ssa_var_num)
166
5.10M
{
167
5.10M
  if (ssa->var_info && ssa_var_num >= 0) {
168
3.77M
    return ssa->var_info[ssa_var_num].type;
169
3.77M
  } else {
170
1.33M
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
1.33M
  }
172
5.10M
}
dce.c:get_ssa_var_info
Line
Count
Source
166
5.73k
{
167
5.73k
  if (ssa->var_info && ssa_var_num >= 0) {
168
5.73k
    return ssa->var_info[ssa_var_num].type;
169
5.73k
  } else {
170
0
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
0
  }
172
5.73k
}
dfa_pass.c:get_ssa_var_info
Line
Count
Source
166
44.3k
{
167
44.3k
  if (ssa->var_info && ssa_var_num >= 0) {
168
44.3k
    return ssa->var_info[ssa_var_num].type;
169
44.3k
  } else {
170
0
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
0
  }
172
44.3k
}
escape_analysis.c:get_ssa_var_info
Line
Count
Source
166
9.77k
{
167
9.77k
  if (ssa->var_info && ssa_var_num >= 0) {
168
9.77k
    return ssa->var_info[ssa_var_num].type;
169
9.77k
  } else {
170
0
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
0
  }
172
9.77k
}
Unexecuted instantiation: sccp.c:get_ssa_var_info
Unexecuted instantiation: zend_call_graph.c:get_ssa_var_info
Unexecuted instantiation: zend_dump.c:get_ssa_var_info
zend_func_info.c:get_ssa_var_info
Line
Count
Source
166
54
{
167
54
  if (ssa->var_info && ssa_var_num >= 0) {
168
54
    return ssa->var_info[ssa_var_num].type;
169
54
  } else {
170
0
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
0
  }
172
54
}
zend_inference.c:get_ssa_var_info
Line
Count
Source
166
2.25M
{
167
2.25M
  if (ssa->var_info && ssa_var_num >= 0) {
168
1.52M
    return ssa->var_info[ssa_var_num].type;
169
1.52M
  } else {
170
727k
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
727k
  }
172
2.25M
}
zend_optimizer.c:get_ssa_var_info
Line
Count
Source
166
2.79M
{
167
2.79M
  if (ssa->var_info && ssa_var_num >= 0) {
168
2.19M
    return ssa->var_info[ssa_var_num].type;
169
2.19M
  } else {
170
602k
    return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
171
602k
  }
172
2.79M
}
Unexecuted instantiation: zend_ssa.c:get_ssa_var_info
173
174
#define DEFINE_SSA_OP_INFO(opN) \
175
  static zend_always_inline uint32_t _ssa_##opN##_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
176
4.98M
  {                                   \
177
4.98M
    if (opline->opN##_type == IS_CONST) {             \
178
1.13M
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
3.85M
    } else { \
180
3.85M
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
3.85M
    } \
182
4.98M
  } \
dce.c:_ssa_op2_info
Line
Count
Source
176
4.03k
  {                                   \
177
4.03k
    if (opline->opN##_type == IS_CONST) {             \
178
0
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
4.03k
    } else { \
180
4.03k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
4.03k
    } \
182
4.03k
  } \
dce.c:_ssa_op1_info
Line
Count
Source
176
1.70k
  {                                   \
177
1.70k
    if (opline->opN##_type == IS_CONST) {             \
178
2
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
1.70k
    } else { \
180
1.70k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
1.70k
    } \
182
1.70k
  } \
Unexecuted instantiation: dce.c:_ssa_result_info
dfa_pass.c:_ssa_op2_info
Line
Count
Source
176
12.6k
  {                                   \
177
12.6k
    if (opline->opN##_type == IS_CONST) {             \
178
1.78k
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
10.8k
    } else { \
180
10.8k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
10.8k
    } \
182
12.6k
  } \
dfa_pass.c:_ssa_op1_info
Line
Count
Source
176
35.0k
  {                                   \
177
35.0k
    if (opline->opN##_type == IS_CONST) {             \
178
1.55k
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
33.4k
    } else { \
180
33.4k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
33.4k
    } \
182
35.0k
  } \
Unexecuted instantiation: dfa_pass.c:_ssa_result_info
escape_analysis.c:_ssa_op1_info
Line
Count
Source
176
8.99k
  {                                   \
177
8.99k
    if (opline->opN##_type == IS_CONST) {             \
178
0
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
8.99k
    } else { \
180
8.99k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
8.99k
    } \
182
8.99k
  } \
escape_analysis.c:_ssa_op2_info
Line
Count
Source
176
778
  {                                   \
177
778
    if (opline->opN##_type == IS_CONST) {             \
178
0
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
778
    } else { \
180
778
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
778
    } \
182
778
  } \
Unexecuted instantiation: escape_analysis.c:_ssa_result_info
Unexecuted instantiation: sccp.c:_ssa_op1_info
Unexecuted instantiation: sccp.c:_ssa_op2_info
Unexecuted instantiation: sccp.c:_ssa_result_info
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_info
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_info
Unexecuted instantiation: zend_call_graph.c:_ssa_result_info
Unexecuted instantiation: zend_dump.c:_ssa_op1_info
Unexecuted instantiation: zend_dump.c:_ssa_op2_info
Unexecuted instantiation: zend_dump.c:_ssa_result_info
zend_func_info.c:_ssa_op1_info
Line
Count
Source
176
544
  {                                   \
177
544
    if (opline->opN##_type == IS_CONST) {             \
178
490
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
490
    } else { \
180
54
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
54
    } \
182
544
  } \
Unexecuted instantiation: zend_func_info.c:_ssa_op2_info
Unexecuted instantiation: zend_func_info.c:_ssa_result_info
zend_inference.c:_ssa_result_info
Line
Count
Source
176
38.6k
  {                                   \
177
38.6k
    if (opline->opN##_type == IS_CONST) {             \
178
0
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
38.6k
    } else { \
180
38.6k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
38.6k
    } \
182
38.6k
  } \
zend_inference.c:_ssa_op1_info
Line
Count
Source
176
1.27M
  {                                   \
177
1.27M
    if (opline->opN##_type == IS_CONST) {             \
178
155k
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
1.12M
    } else { \
180
1.12M
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
1.12M
    } \
182
1.27M
  } \
zend_inference.c:_ssa_op2_info
Line
Count
Source
176
1.16M
  {                                   \
177
1.16M
    if (opline->opN##_type == IS_CONST) {             \
178
398k
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
770k
    } else { \
180
770k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
770k
    } \
182
1.16M
  } \
zend_optimizer.c:_ssa_op1_info
Line
Count
Source
176
1.21M
  {                                   \
177
1.21M
    if (opline->opN##_type == IS_CONST) {             \
178
243k
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
973k
    } else { \
180
973k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
973k
    } \
182
1.21M
  } \
zend_optimizer.c:_ssa_op2_info
Line
Count
Source
176
1.21M
  {                                   \
177
1.21M
    if (opline->opN##_type == IS_CONST) {             \
178
329k
      return _const_op_type(CRT_CONSTANT(opline->opN)); \
179
888k
    } else { \
180
888k
      return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \
181
888k
    } \
182
1.21M
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_result_info
Unexecuted instantiation: zend_ssa.c:_ssa_op1_info
Unexecuted instantiation: zend_ssa.c:_ssa_op2_info
Unexecuted instantiation: zend_ssa.c:_ssa_result_info
183
184
#define DEFINE_SSA_OP_DEF_INFO(opN) \
185
  static zend_always_inline uint32_t _ssa_##opN##_def_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
186
934k
  { \
187
934k
    return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \
188
934k
  } \
Unexecuted instantiation: dce.c:_ssa_op1_def_info
Unexecuted instantiation: dce.c:_ssa_op2_def_info
Unexecuted instantiation: dce.c:_ssa_result_def_info
Unexecuted instantiation: dfa_pass.c:_ssa_op1_def_info
Unexecuted instantiation: dfa_pass.c:_ssa_op2_def_info
Unexecuted instantiation: dfa_pass.c:_ssa_result_def_info
Unexecuted instantiation: escape_analysis.c:_ssa_op1_def_info
Unexecuted instantiation: escape_analysis.c:_ssa_op2_def_info
Unexecuted instantiation: escape_analysis.c:_ssa_result_def_info
Unexecuted instantiation: sccp.c:_ssa_op1_def_info
Unexecuted instantiation: sccp.c:_ssa_op2_def_info
Unexecuted instantiation: sccp.c:_ssa_result_def_info
Unexecuted instantiation: zend_call_graph.c:_ssa_op1_def_info
Unexecuted instantiation: zend_call_graph.c:_ssa_op2_def_info
Unexecuted instantiation: zend_call_graph.c:_ssa_result_def_info
Unexecuted instantiation: zend_dump.c:_ssa_op1_def_info
Unexecuted instantiation: zend_dump.c:_ssa_op2_def_info
Unexecuted instantiation: zend_dump.c:_ssa_result_def_info
Unexecuted instantiation: zend_func_info.c:_ssa_op1_def_info
Unexecuted instantiation: zend_func_info.c:_ssa_op2_def_info
Unexecuted instantiation: zend_func_info.c:_ssa_result_def_info
Unexecuted instantiation: zend_inference.c:_ssa_op1_def_info
Unexecuted instantiation: zend_inference.c:_ssa_op2_def_info
Unexecuted instantiation: zend_inference.c:_ssa_result_def_info
zend_optimizer.c:_ssa_op1_def_info
Line
Count
Source
186
6.31k
  { \
187
6.31k
    return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \
188
6.31k
  } \
zend_optimizer.c:_ssa_result_def_info
Line
Count
Source
186
928k
  { \
187
928k
    return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \
188
928k
  } \
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_def_info
Unexecuted instantiation: zend_ssa.c:_ssa_op1_def_info
Unexecuted instantiation: zend_ssa.c:_ssa_op2_def_info
Unexecuted instantiation: zend_ssa.c:_ssa_result_def_info
189
190
191
DEFINE_SSA_OP_INFO(op1)
192
DEFINE_SSA_OP_INFO(op2)
193
DEFINE_SSA_OP_INFO(result)
194
DEFINE_SSA_OP_DEF_INFO(op1)
195
DEFINE_SSA_OP_DEF_INFO(op2)
196
DEFINE_SSA_OP_DEF_INFO(result)
197
198
2.50M
#define OP1_INFO()           (_ssa_op1_info(op_array, ssa, opline, ssa_op))
199
2.40M
#define OP2_INFO()           (_ssa_op2_info(op_array, ssa, opline, ssa_op))
200
34.4k
#define OP1_DATA_INFO()      (_ssa_op1_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL))
201
#define OP2_DATA_INFO()      (_ssa_op2_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL))
202
38.6k
#define RES_USE_INFO()       (_ssa_result_info(op_array, ssa, opline, ssa_op))
203
6.31k
#define OP1_DEF_INFO()       (_ssa_op1_def_info(op_array, ssa, opline, ssa_op))
204
#define OP2_DEF_INFO()       (_ssa_op2_def_info(op_array, ssa, opline, ssa_op))
205
#define OP1_DATA_DEF_INFO()  (_ssa_op1_def_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL))
206
#define OP2_DATA_DEF_INFO()  (_ssa_op2_def_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL))
207
928k
#define RES_INFO()           (_ssa_result_def_info(op_array, ssa, opline, ssa_op))
208
209
8.49k
static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) {
210
8.49k
  return (b > 0 && a > ZEND_LONG_MAX - b)
211
8.49k
    || (b < 0 && a < ZEND_LONG_MIN - b);
212
8.49k
}
Unexecuted instantiation: dce.c:zend_add_will_overflow
Unexecuted instantiation: dfa_pass.c:zend_add_will_overflow
Unexecuted instantiation: escape_analysis.c:zend_add_will_overflow
Unexecuted instantiation: sccp.c:zend_add_will_overflow
Unexecuted instantiation: zend_call_graph.c:zend_add_will_overflow
Unexecuted instantiation: zend_dump.c:zend_add_will_overflow
Unexecuted instantiation: zend_func_info.c:zend_add_will_overflow
zend_inference.c:zend_add_will_overflow
Line
Count
Source
209
3.20k
static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) {
210
3.20k
  return (b > 0 && a > ZEND_LONG_MAX - b)
211
3.20k
    || (b < 0 && a < ZEND_LONG_MIN - b);
212
3.20k
}
Unexecuted instantiation: zend_optimizer.c:zend_add_will_overflow
zend_ssa.c:zend_add_will_overflow
Line
Count
Source
209
5.28k
static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) {
210
5.28k
  return (b > 0 && a > ZEND_LONG_MAX - b)
211
5.28k
    || (b < 0 && a < ZEND_LONG_MIN - b);
212
5.28k
}
213
8.54k
static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) {
214
8.54k
  return (b > 0 && a < ZEND_LONG_MIN + b)
215
8.54k
    || (b < 0 && a > ZEND_LONG_MAX + b);
216
8.54k
}
Unexecuted instantiation: dce.c:zend_sub_will_overflow
Unexecuted instantiation: dfa_pass.c:zend_sub_will_overflow
Unexecuted instantiation: escape_analysis.c:zend_sub_will_overflow
Unexecuted instantiation: sccp.c:zend_sub_will_overflow
Unexecuted instantiation: zend_call_graph.c:zend_sub_will_overflow
Unexecuted instantiation: zend_dump.c:zend_sub_will_overflow
Unexecuted instantiation: zend_func_info.c:zend_sub_will_overflow
zend_inference.c:zend_sub_will_overflow
Line
Count
Source
213
5.94k
static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) {
214
5.94k
  return (b > 0 && a < ZEND_LONG_MIN + b)
215
5.94k
    || (b < 0 && a > ZEND_LONG_MAX + b);
216
5.94k
}
Unexecuted instantiation: zend_optimizer.c:zend_sub_will_overflow
zend_ssa.c:zend_sub_will_overflow
Line
Count
Source
213
2.59k
static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) {
214
2.59k
  return (b > 0 && a < ZEND_LONG_MIN + b)
215
2.59k
    || (b < 0 && a > ZEND_LONG_MAX + b);
216
2.59k
}
217
218
BEGIN_EXTERN_C()
219
220
ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa);
221
ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa);
222
ZEND_API zend_result zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level);
223
224
ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert);
225
226
ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp);
227
228
ZEND_API uint32_t zend_fetch_arg_info_type(
229
  const zend_script *script, const zend_arg_info *arg_info, zend_class_entry **pce);
230
ZEND_API void zend_init_func_return_info(
231
  const zend_op_array *op_array, const zend_script *script, zend_ssa_var_info *ret);
232
uint32_t zend_get_return_info_from_signature_only(
233
    const zend_function *func, const zend_script *script,
234
    zend_class_entry **ce, bool *ce_is_instanceof, bool use_tentative_return_info);
235
236
ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, const zend_ssa *ssa, uint32_t t1, uint32_t t2);
237
ZEND_API bool zend_may_throw(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, const zend_ssa *ssa);
238
239
ZEND_API zend_result zend_update_type_info(
240
  const zend_op_array *op_array, zend_ssa *ssa, const zend_script *script,
241
  zend_op *opline, zend_ssa_op *ssa_op, const zend_op **ssa_opcodes,
242
  zend_long optimization_level);
243
244
END_EXTERN_C()
245
246
#endif /* ZEND_INFERENCE_H */