]> granicus.if.org Git - php/commitdiff
Fixed bug #34786 (2 @ results in change to error_reporting() to random value)
authorDmitry Stogov <dmitry@php.net>
Mon, 10 Oct 2005 10:54:45 +0000 (10:54 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 10 Oct 2005 10:54:45 +0000 (10:54 +0000)
Zend/tests/bug34786.phpt [new file with mode: 0755]
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

diff --git a/Zend/tests/bug34786.phpt b/Zend/tests/bug34786.phpt
new file mode 100755 (executable)
index 0000000..1864284
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+Bug #34786 (2 @ results in change to error_reporting() to random value)
+--FILE--
+<?php
+function foo($a,$b,$c) {
+echo "foo: ".error_reporting()."\n";
+}
+
+function bar() {
+echo "bar: ".error_reporting()."\n";
+}
+
+error_reporting(1);
+echo "before: ".error_reporting()."\n";
+@foo(1,@bar(),3);
+echo "after: ".error_reporting()."\n";
+?>
+--EXPECT--
+before: 1
+bar: 0
+foo: 0
+after: 1
index fb20ffb8fc879394db1a1e0c06768e3c202cd71d..f9f70ce06e516f875b1b81a4af6df6662bfb5694 100644 (file)
@@ -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;
        }
        
index 89f4402b31804280923daa9a95233bd7887ab21b..4ce2d364b1805026875f2e81b6e84ac56502972e 100644 (file)
@@ -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;
        }