From 98294fbf3f786417c57b65bd11040694cce9f5d1 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Oct 2005 10:54:45 +0000 Subject: [PATCH] Fixed bug #34786 (2 @ results in change to error_reporting() to random value) --- Zend/tests/bug34786.phpt | 22 ++++++++++++++++++++++ Zend/zend_vm_def.h | 4 ++-- Zend/zend_vm_execute.h | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100755 Zend/tests/bug34786.phpt diff --git a/Zend/tests/bug34786.phpt b/Zend/tests/bug34786.phpt new file mode 100755 index 0000000000..18642848d8 --- /dev/null +++ b/Zend/tests/bug34786.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #34786 (2 @ results in change to error_reporting() to random value) +--FILE-- + +--EXPECT-- +before: 1 +bar: 0 +foo: 0 +after: 1 diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index fb20ffb8fc..f9f70ce06e 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3581,9 +3581,9 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) { zend_op *opline = EX(opline); + EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting); + EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */ if (EX(old_error_reporting) == NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting); - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */ EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 89f4402b31..4ce2d364b1 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -438,9 +438,9 @@ static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); + EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting); + EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */ if (EX(old_error_reporting) == NULL) { - EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting); - EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */ EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; } -- 2.50.1