Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6465,7 +6465,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
}

zend_compile_params(params_ast, return_type_ast,
is_method && zend_string_equals_literal_ci(decl->name, "__toString") ? IS_STRING : 0);
is_method && zend_string_equals_literal(method_lcname, ZEND_TOSTRING_FUNC_NAME) ? IS_STRING : 0);
if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) {
zend_mark_function_as_generator();
zend_emit_op(NULL, ZEND_GENERATOR_CREATE, NULL, NULL);
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_type_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@
#define MAY_BE_ARRAY_KEY_ANY (MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_KEY_STRING)

#define MAY_BE_CLASS (1<<23)
#define MAY_BE_INDIRECT (1<<24)

#endif /* ZEND_TYPE_INFO_H */
5 changes: 4 additions & 1 deletion azure/macos/brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ parameters:
packages: ''

steps:
- script: brew update
displayName: 'Update Homebrew'
- script: |
brew install pkg-config \
autoconf \
Expand All @@ -23,11 +25,12 @@ steps:
zlib \
t1lib \
gd \
libzip \
gmp \
tidyp \
libxml2 \
libxslt \
postgresql
# Make sure we don't get broken libzip 1.7.0
brew upgrade libzip
brew link icu4c gettext --force
displayName: 'Install Build Dependencies'
29 changes: 7 additions & 22 deletions ext/enchant/enchant.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,11 @@ PHP_FUNCTION(enchant_broker_get_error)
}
/* }}} */

#if HAVE_ENCHANT_BROKER_SET_PARAM
/* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value)
Set the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_set_dict_path)
{
zval *broker;
enchant_broker *pbroker;
zend_long dict_type;
char *value;
size_t value_len;
Expand All @@ -361,6 +359,8 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
RETURN_THROWS();
}

#if HAVE_ENCHANT_BROKER_SET_PARAM
enchant_broker *pbroker;
if (!value_len) {
RETURN_FALSE;
}
Expand All @@ -383,6 +383,7 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
default:
RETURN_FALSE;
}
#endif
}
/* }}} */

Expand All @@ -392,14 +393,15 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
PHP_FUNCTION(enchant_broker_get_dict_path)
{
zval *broker;
enchant_broker *pbroker;
zend_long dict_type;
char *value;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &broker, enchant_broker_ce, &dict_type) == FAILURE) {
RETURN_THROWS();
}

#if HAVE_ENCHANT_BROKER_SET_PARAM
enchant_broker *pbroker;
char *value;
PHP_ENCHANT_GET_BROKER;

switch (dict_type) {
Expand All @@ -423,26 +425,9 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
}

RETURN_STRING(value);
#endif
}
/* }}} */
#else
/* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value)
Set the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_set_dict_path)
{
RETURN_FALSE;
}
/* }}} */


/* {{{ proto string enchant_broker_get_dict_path(resource broker, int dict_type)
Get the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_get_dict_path)
{
RETURN_FALSE;
}
/* }}} */
#endif

/* {{{ proto array enchant_broker_list_dicts(resource broker)
Lists the dictionaries available for the given broker */
Expand Down
27 changes: 25 additions & 2 deletions ext/opcache/Optimizer/zend_inference.c
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,9 @@ uint32_t zend_array_element_type(uint32_t t1, int write, int insert)
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
}
}
if (write) {
tmp |= MAY_BE_INDIRECT;
}
}
if (t1 & MAY_BE_STRING) {
tmp |= MAY_BE_STRING | MAY_BE_RC1;
Expand Down Expand Up @@ -3398,7 +3401,7 @@ static zend_always_inline int _zend_update_type_info(
tmp = zend_fetch_prop_type(script,
zend_fetch_prop_info(op_array, ssa, opline, ssa_op), &ce);
if (opline->result_type != IS_TMP_VAR) {
tmp |= MAY_BE_REF;
tmp |= MAY_BE_REF | MAY_BE_INDIRECT;
}
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
if (ce) {
Expand All @@ -3415,7 +3418,7 @@ static zend_always_inline int _zend_update_type_info(
tmp = zend_fetch_prop_type(script,
zend_fetch_static_prop_info(script, op_array, ssa, opline), &ce);
if (opline->result_type != IS_TMP_VAR) {
tmp |= MAY_BE_REF;
tmp |= MAY_BE_REF | MAY_BE_INDIRECT;
}
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
if (ce) {
Expand Down Expand Up @@ -3524,6 +3527,26 @@ static zend_always_inline int _zend_update_type_info(
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
} else {
tmp |= MAY_BE_REF | MAY_BE_RC1 | MAY_BE_RCN;
switch (opline->opcode) {
case ZEND_FETCH_W:
case ZEND_FETCH_RW:
case ZEND_FETCH_FUNC_ARG:
case ZEND_FETCH_UNSET:
case ZEND_FETCH_DIM_W:
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
case ZEND_FETCH_DIM_UNSET:
case ZEND_FETCH_OBJ_W:
case ZEND_FETCH_OBJ_RW:
case ZEND_FETCH_OBJ_FUNC_ARG:
case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_STATIC_PROP_W:
case ZEND_FETCH_STATIC_PROP_RW:
case ZEND_FETCH_STATIC_PROP_FUNC_ARG:
case ZEND_FETCH_STATIC_PROP_UNSET:
tmp |= MAY_BE_INDIRECT;
break;
}
}
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
}
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/Optimizer/zend_inference.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static zend_always_inline uint32_t get_ssa_var_info(const zend_ssa *ssa, int ssa
if (ssa->var_info && ssa_var_num >= 0) {
return ssa->var_info[ssa_var_num].type;
} else {
return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
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;
}
}

Expand Down
28 changes: 13 additions & 15 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ static void* dasm_labels[zend_lb_MAX];
// zval should be in FCARG1a
|.macro ZVAL_DTOR_FUNC, var_info, opline // arg1 must be in FCARG1a
|| do {
|| if (has_concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
|| if (has_concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_INDIRECT))) {
|| zend_uchar type = concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
|| if (type == IS_STRING && !ZEND_DEBUG) {
| EXT_CALL _efree, r0
Expand Down Expand Up @@ -1355,7 +1355,7 @@ static void* dasm_labels[zend_lb_MAX];

|.macro ZVAL_PTR_DTOR, addr, op_info, gc, cold, opline
|| if ((op_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) {
|| if ((op_info) & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
|| if ((op_info) & ((MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_INDIRECT)-(MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
| // if (Z_REFCOUNTED_P(cv)) {
|| if (cold) {
| IF_ZVAL_REFCOUNTED addr, >1
Expand Down Expand Up @@ -8916,12 +8916,15 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, const zend
}

if (opline->op1_type == IS_VAR) {
| LOAD_ZVAL_ADDR r0, op1_addr
| // if (EXPECTED(Z_TYPE_P(ret) == IS_INDIRECT)) {
| IF_NOT_Z_TYPE r0, IS_INDIRECT, >1
| // ret = Z_INDIRECT_P(ret);
| GET_Z_PTR r0, r0
|1:
if (op1_info & MAY_BE_INDIRECT) {
| LOAD_ZVAL_ADDR r0, op1_addr
| // if (EXPECTED(Z_TYPE_P(ret) == IS_INDIRECT)) {
| IF_NOT_Z_TYPE r0, IS_INDIRECT, >1
| // ret = Z_INDIRECT_P(ret);
| GET_Z_PTR r0, r0
|1:
op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 0);
}
} else if (opline->op1_type == IS_CV) {
if (op1_info & MAY_BE_UNDEF) {
if (op1_info & (MAY_BE_ANY|MAY_BE_REF)) {
Expand All @@ -8939,13 +8942,8 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, const zend

if (op1_info & (MAY_BE_UNDEF|MAY_BE_ANY|MAY_BE_REF)) {
if (op1_info & MAY_BE_REF) {
if (opline->op1_type == IS_VAR) {
| IF_NOT_Z_TYPE r0, IS_REFERENCE, >2
| GET_Z_PTR r1, r0
} else {
| IF_NOT_ZVAL_TYPE op1_addr, IS_REFERENCE, >2
| GET_ZVAL_PTR r1, op1_addr
}
| IF_NOT_ZVAL_TYPE op1_addr, IS_REFERENCE, >2
| GET_ZVAL_PTR r1, op1_addr
| GC_ADDREF r1
| SET_ZVAL_PTR arg_addr, r1
| SET_ZVAL_TYPE_INFO arg_addr, IS_REFERENCE_EX
Expand Down
2 changes: 1 addition & 1 deletion ext/zip/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PHP_ARG_WITH([zip],
[Include Zip read/write support])])

if test "$PHP_ZIP" != "no"; then
PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11])
PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0])

PHP_EVAL_INCLINE($LIBZIP_CFLAGS)
PHP_EVAL_LIBLINE($LIBZIP_LIBS, ZIP_SHARED_LIBADD)
Expand Down
2 changes: 1 addition & 1 deletion sapi/cli/tests/017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Snippet no. 5:
Interactive shell


Parse error: syntax error, unexpected ')' in php shell code on line 1
Parse error: Unmatched ')' in php shell code on line 1


Done
2 changes: 1 addition & 1 deletion sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $tester->start();
$tester->expectLogStartNotices();
$tester->request()->expectEmptyBody();
$tester->request()->expectEmptyBody();
$tester->terminate();
$tester->expectLogLine('msg 1 - ', false);
$tester->expectLogLine('msg 2 - msg 3', true);
$tester->terminate();
$tester->close();

?>
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/tests/log-bwd-multiple-msgs.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $tester->start();
$tester->expectLogStartNotices();
$tester->request()->expectEmptyBody();
$tester->request()->expectEmptyBody();
$tester->terminate();
$tester->expectLogLine('msg 1 - msg 2 - msg 3');
$tester->expectLogLine('msg 1 - msg 2 - msg 3');
$tester->terminate();
$tester->close();
?>
Done
Expand Down