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
8 changes: 7 additions & 1 deletion Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
}
/* }}} */

#if ZEND_DEBUG
# define SIGNAL_CHECK_DEFAULT "1"
#else
# define SIGNAL_CHECK_DEFAULT "0"
#endif

ZEND_INI_BEGIN()
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
Expand All @@ -166,7 +172,7 @@ ZEND_INI_BEGIN()
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
#ifdef ZEND_SIGNALS
STD_ZEND_INI_BOOLEAN("zend.signal_check", ZEND_DEBUG ? "1" : "0", ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals)
STD_ZEND_INI_BOOLEAN("zend.signal_check", SIGNAL_CHECK_DEFAULT, ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals)
#endif
STD_ZEND_INI_BOOLEAN("zend.exception_ignore_args", "0", ZEND_INI_ALL, OnUpdateBool, exception_ignore_args, zend_executor_globals, executor_globals)
ZEND_INI_END()
Expand Down
9 changes: 4 additions & 5 deletions docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@
highlight the major important things (security fixes) and when it is
important to upgrade.

* Call `php bin/createNewsEntry` in your local phpweb checkout.
* Use the "frontpage" and "releases" category.
* Add the content for the news entry.
* Call `php bin/createReleaseEntry -v <version> [ --security ]` in your
local phpweb checkout.

7. Commit and push all the changes to their respective git repos

Expand Down Expand Up @@ -364,8 +363,8 @@
highlight the major important things (security fixes) and when it is
important to upgrade.

* Call `php bin/createNewsEntry` in your local phpweb checkout.
* Add the content for the news entry.
* Call `php bin/createReleaseEntry -v <version> [ --security ]` in your
local phpweb checkout.

4. Commit all the changes (`include/version.inc`, `archive/archive.xml`,
`archive/entries/YYYY-MM-DD-N.xml`).
Expand Down
2 changes: 0 additions & 2 deletions ext/curl/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

#define SAVE_CURLSH_ERROR(__handle, __err) (__handle)->err.no = (int) __err;

zend_class_entry *curl_share_ce;

/* {{{ proto CurlShareHandle curl_share_init()
Initialize a share curl handle */
PHP_FUNCTION(curl_share_init)
Expand Down
28 changes: 0 additions & 28 deletions ext/date/tests/bug48187.phpt

This file was deleted.

10 changes: 6 additions & 4 deletions ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2767,9 +2767,14 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
ce = NULL;
if (opline->op1_type == IS_UNUSED) {
op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN;
op1_addr = 0;
ce = op_array->scope;
} else {
op1_info = OP1_INFO();
if (!(op1_info & MAY_BE_OBJECT)) {
break;
}
op1_addr = OP1_REG_ADDR();
if (ssa->var_info && ssa->ops) {
zend_ssa_op *ssa_op = &ssa->ops[opline - op_array->opcodes];
if (ssa_op->op1_use >= 0) {
Expand All @@ -2780,11 +2785,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
}
}
}
if (!(op1_info & MAY_BE_OBJECT)) {
break;
}
if (!zend_jit_fetch_obj_read(&dasm_state, opline, op_array,
op1_info, ce,
op1_info, op1_addr, ce,
zend_may_throw(opline, ssa_op, op_array, ssa))) {
goto jit_failure;
}
Expand Down
35 changes: 31 additions & 4 deletions ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,23 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
}
}
break;
case ZEND_FETCH_OBJ_FUNC_ARG:
if (!frame
|| !frame->call
|| !frame->call->func
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(frame->call)) {
break;
}
/* break missing intentionally */
case ZEND_FETCH_OBJ_R:
case ZEND_FETCH_OBJ_IS:
if (opline->op2_type != IS_CONST
|| Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING
|| Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') {
break;
}
ADD_OP1_TRACE_GUARD();
break;
default:
break;
}
Expand Down Expand Up @@ -3720,8 +3737,21 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
if (opline->op1_type == IS_UNUSED) {
op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN;
ce = op_array->scope;
op1_addr = 0;
} else {
op1_info = OP1_INFO();
if (!(op1_info & MAY_BE_OBJECT)) {
break;
}
op1_addr = OP1_REG_ADDR();
if (orig_op1_type != IS_UNKNOWN
&& (orig_op1_type & IS_TRACE_REFERENCE)) {
if (!zend_jit_fetch_reference(&dasm_state, opline, orig_op1_type, &op1_info, &op1_addr, 1)) {
goto jit_failure;
}
} else {
CHECK_OP1_TRACE_TYPE();
}
if (ssa->var_info && ssa->ops) {
if (ssa_op->op1_use >= 0) {
zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use;
Expand All @@ -3731,11 +3761,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
}
}
}
if (!(op1_info & MAY_BE_OBJECT)) {
break;
}
if (!zend_jit_fetch_obj_read(&dasm_state, opline, op_array,
op1_info, ce,
op1_info, op1_addr, ce,
zend_may_throw(opline, ssa_op, op_array, ssa))) {
goto jit_failure;
}
Expand Down
16 changes: 9 additions & 7 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -10789,12 +10789,11 @@ static zend_bool zend_may_be_dynamic_property(zend_class_entry *ce, zend_string
return 0;
}

static int zend_jit_fetch_obj_read(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, uint32_t op1_info, zend_class_entry *ce, int may_throw)
static int zend_jit_fetch_obj_read(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, uint32_t op1_info, zend_jit_addr op1_addr, zend_class_entry *ce, int may_throw)
{
zval *member;
uint32_t offset;
zend_bool may_be_dynamic = 1;
zend_jit_addr op1_addr = 0, orig_op1_addr = 0;
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
zend_jit_addr this_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, offsetof(zend_execute_data, This));
zend_jit_addr prop_addr;
Expand All @@ -10809,11 +10808,10 @@ static int zend_jit_fetch_obj_read(dasm_State **Dst, const zend_op *opline, cons
if (opline->op1_type == IS_UNUSED) {
| GET_ZVAL_PTR FCARG1a, this_addr
} else {
op1_addr = orig_op1_addr = OP1_ADDR();
if (op1_info & MAY_BE_REF) {
| LOAD_ZVAL_ADDR r0, op1_addr
| ZVAL_DEREF r0, op1_info
op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 0);
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
| ZVAL_DEREF FCARG1a, op1_info
op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 0);
}
if (op1_info & ((MAY_BE_UNDEF|MAY_BE_ANY)- MAY_BE_OBJECT)) {
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
Expand Down Expand Up @@ -10895,14 +10893,18 @@ static int zend_jit_fetch_obj_read(dasm_State **Dst, const zend_op *opline, cons
if (opline->opcode != ZEND_FETCH_OBJ_IS) {
| SAVE_VALID_OPLINE opline, r1
if (op1_info & MAY_BE_UNDEF) {
zend_jit_addr orig_op1_addr = OP1_ADDR();

if (op1_info & MAY_BE_ANY) {
| IF_NOT_ZVAL_TYPE op1_addr, IS_UNDEF, >1
}
| mov FCARG1d, opline->op1.var
| EXT_CALL zend_jit_undefined_op_helper, r0
|1:
| LOAD_ZVAL_ADDR FCARG1a, orig_op1_addr
} else {
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
}
| LOAD_ZVAL_ADDR FCARG1a, orig_op1_addr
| LOAD_ADDR FCARG2a, Z_STRVAL_P(member)
| EXT_CALL zend_jit_invalid_property_read, r0
}
Expand Down
33 changes: 0 additions & 33 deletions ext/openssl/tests/streams_crypto_method.pem

This file was deleted.

13 changes: 12 additions & 1 deletion ext/openssl/tests/streams_crypto_method.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ if (!function_exists("proc_open")) die("skip no proc_open");
?>
--FILE--
<?php
$certFile = __DIR__ . DIRECTORY_SEPARATOR . 'streams_crypto_method.pem.tmp';

$serverCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/streams_crypto_method.pem',
'local_cert' => '%s',
]]);

$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
Expand All @@ -33,6 +35,7 @@ $serverCode = <<<'CODE'
fclose($client);
}
CODE;
$serverCode = sprintf($serverCode, $certFile);

$clientCode = <<<'CODE'
$serverUri = "https://127.0.0.1:64321/";
Expand All @@ -47,8 +50,16 @@ $clientCode = <<<'CODE'
echo file_get_contents($serverUri, false, $clientCtx);
CODE;

include 'CertificateGenerator.inc';
$certificateGenerator = new CertificateGenerator();
$certificateGenerator->saveNewCertAsFileWithKey('streams_crypto_method', $certFile);

include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
?>
--CLEAN--
<?php
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'streams_crypto_method.pem.tmp');
?>
--EXPECT--
Hello World!
15 changes: 14 additions & 1 deletion ext/openssl/tests/tls_min_v1.0_max_v1.1_wrapper.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ if (!function_exists("proc_open")) die("skip no proc_open");
?>
--FILE--
<?php
$certFile = __DIR__ . DIRECTORY_SEPARATOR . 'tls_min_v1.0_max_v1.1_wrapper.pem.tmp';

$serverCode = <<<'CODE'
$flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN;
$ctx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/streams_crypto_method.pem',
'local_cert' => '%s',
'min_proto_version' => STREAM_CRYPTO_PROTO_TLSv1_0,
'max_proto_version' => STREAM_CRYPTO_PROTO_TLSv1_1,
'security_level' => 1,
]]);

$server = stream_socket_server('tls://127.0.0.1:64321', $errno, $errstr, $flags, $ctx);
Expand All @@ -22,12 +25,14 @@ $serverCode = <<<'CODE'
@stream_socket_accept($server, 3);
}
CODE;
$serverCode = sprintf($serverCode, $certFile);

$clientCode = <<<'CODE'
$flags = STREAM_CLIENT_CONNECT;
$ctx = stream_context_create(['ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'security_level' => 1,
]]);

phpt_wait();
Expand All @@ -51,9 +56,17 @@ $clientCode = <<<'CODE'
var_dump($client);
CODE;

include 'CertificateGenerator.inc';
$certificateGenerator = new CertificateGenerator();
$certificateGenerator->saveNewCertAsFileWithKey('tls_min_v1.0_max_v1.1_wrapper', $certFile);

include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
?>
--CLEAN--
<?php
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tls_min_v1.0_max_v1.1_wrapper.pem.tmp');
?>
--EXPECTF--
resource(%d) of type (stream)
bool(false)
Expand Down
15 changes: 14 additions & 1 deletion ext/openssl/tests/tls_wrapper.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ if (OPENSSL_VERSION_NUMBER < 0x10101000) die("skip OpenSSL v1.1.1 required");
?>
--FILE--
<?php
$certFile = __DIR__ . DIRECTORY_SEPARATOR . 'tls_wrapper.pem.tmp';

$serverCode = <<<'CODE'
$flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN;
$ctx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/streams_crypto_method.pem',
'local_cert' => '%s',
'security_level' => 1,
]]);

$server = stream_socket_server('tls://127.0.0.1:64321', $errno, $errstr, $flags, $ctx);
Expand All @@ -21,12 +24,14 @@ $serverCode = <<<'CODE'
@stream_socket_accept($server, 3);
}
CODE;
$serverCode = sprintf($serverCode, $certFile);

$clientCode = <<<'CODE'
$flags = STREAM_CLIENT_CONNECT;
$ctx = stream_context_create(['ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'security_level' => 1,
]]);

phpt_wait();
Expand All @@ -50,9 +55,17 @@ $clientCode = <<<'CODE'
var_dump($client);
CODE;

include 'CertificateGenerator.inc';
$certificateGenerator = new CertificateGenerator();
$certificateGenerator->saveNewCertAsFileWithKey('tls_wrapper', $certFile);

include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
?>
--CLEAN--
<?php
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tls_wrapper.pem.tmp');
?>
--EXPECTF--
resource(%d) of type (stream)
bool(false)
Expand Down
Loading