Skip to content

Instantly share code, notes, and snippets.

Dmitry Stogov dstogov

Block or report user

Report or block dstogov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tp_jit_01.php
<?php
class Foo {
public ?string $p;
}
$a = new Foo;
$ref = &$a->p;
$ref[] = "bar";
echo "OPS!\n";
View jit_fix.diff
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index ba3d4b36fe..7352c6a435 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -3980,7 +3980,8 @@ static int zend_jit_concat(dasm_State **Dst, const zend_op *opline, int *opnum,
if (opline->result_type == IS_TMP_VAR &&
(opline+1)->opcode == ZEND_SEND_VAL &&
(opline+1)->op1_type == IS_TMP_VAR &&
- (opline+1)->op1.var == opline->result.var) {
+ (opline+1)->op1.var == opline->result.var &&
View qm_assign_fix.diff
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 46ec6c0769..983d5cf1a9 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -892,7 +892,12 @@ optimize_const_unary_op:
!zend_bitset_in(used_ext, VAR_NUM(opline->op1.var))) {
/* T1 = ..., T2 = QM_ASSIGN(T1) to T2 = ..., NOP */
src = VAR_SOURCE(opline->op1);
- if (src) {
+ if (src &&
View smart_branch-16.diff
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 2d5fd66efd..3c9b0f834b 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2000,22 +2000,31 @@ ZEND_API int zend_is_smart_branch(zend_op *opline) /* {{{ */
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
{
uint32_t opnum = get_next_op_number();
- zend_op *opline;
+ zend_op *opline = CG(active_op_array)->opcodes + opnum -1;
View enter-23.diff
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 9f499baf6f..860b4d0a85 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5914,6 +5914,8 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
zend_oparray_context_begin(&orig_oparray_context);
+ zend_emit_op(NULL, ZEND_ENTER, NULL, NULL);
+
View gc_remove_ref.diff
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index 97a7edaac2..4dd0ed14c7 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -1344,16 +1344,24 @@ static void gc_remove_nested_data_from_buffer(zend_refcounted *ref, gc_root_buff
zval *zv;
tail_call:
- if (root ||
- (GC_REF_ADDRESS(ref) != 0 &&
View timeout_check.diff
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 9f10843b6b..c510ef7d53 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1165,6 +1165,7 @@ ZEND_API ZEND_NORETURN void zend_timeout(int dummy) /* {{{ */
#ifndef ZEND_WIN32
static void zend_timeout_handler(int dummy) /* {{{ */
{
+ zend_error(E_NOTICE, "Timeout signal [%d] delivered", dummy);
#ifndef ZTS
View bug78379-php7.2.diff
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index 47236a934e..d5fc550a77 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -388,11 +388,14 @@ tail_call:
ZVAL_OBJ(&tmp, obj);
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
+ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_GET_COLOR(ht) != GC_GREY)) {
View early_binding.diff
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 6721612b4c..de0ac1fe13 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -278,6 +278,9 @@ typedef struct _zend_oparray_context {
/* Class has unresolved variance obligations. | | | */
#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 21) /* X | | | */
/* | | | */
+/* Method compatibility already checked. | | | */
+#define ZEND_ACC_CHECKED (1 << 22) /* X | | | */
View variance_bug.php
<?php
class X {
}
abstract class A {
abstract function __construct(X $x);
}
class B extends A {
function __construct(object $x) {}
}
class C extends B {
You can’t perform that action at this time.