From 3019a1c6a39b27ca8a74b4726bd2629e22095aea Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Oct 2005 10:53:52 +0000 Subject: [PATCH] Fixed bug #34786 (2 @ results in change to error_reporting() to random value) --- NEWS | 2 ++ Zend/tests/bug34786.phpt | 22 ++++++++++++++++++++++ Zend/zend_vm_def.h | 4 ++-- Zend/zend_vm_execute.h | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100755 Zend/tests/bug34786.phpt diff --git a/NEWS b/NEWS index bab67adfe6..c467282198 100644 --- a/NEWS +++ b/NEWS @@ -48,6 +48,8 @@ PHP NEWS - Fixed bug #34788 (SOAP Client not applying correct namespace to generated values). (Dmitry) - Fixed bug #34787 (SOAP Client not handling boolean types correctly). (Dmitry) +- Fixed bug #34786 (2 @ results in change to error_reporting() to random value) + (Dmitry, Tony) - Fixed bug #34785 (subclassing of mysqli_stmt does not work). (Georg) - Fixed bug #34777 (Crash in dblib when fetching non-existent error info). (Ilia) - Fixed bug #34771 (strtotime() fails with 1-12am/pm). (Derick) 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 9b2c65b13b..af8d7ab163 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3447,9 +3447,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 0f4de8e4cd..35d51db68d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -429,9 +429,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