]> granicus.if.org Git - php/commitdiff
Fixed assertion on phpMyAdmin-4.7.5 home page
authorDmitry Stogov <dmitry@zend.com>
Wed, 8 Nov 2017 09:51:53 +0000 (12:51 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 8 Nov 2017 09:51:53 +0000 (12:51 +0300)
NEWS
ext/opcache/Optimizer/zend_ssa.c
ext/opcache/tests/ssa_bug_010.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 26b89968915983a7cccf6a2750a4c13539357a65..4288addef4d8b7d1062a558a47abb21f68433419 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,9 @@ PHP                                                                        NEWS
   . Fixed bug #75434 (Wrong reflection for mysqli_fetch_all function). (Fabien
     Villepinte)
 
+- Opcache:
+  . Fixed assertion on phpMyAdmin-4.7.5 home page. (Dmitry)
+
 - SOAP:
   . Fixed bug #75464 (Wrong reflection on SoapClient::__setSoapHeaders). (villfa)
 
index 529cb6166eef7b582f6219930d89c5a12b3a90e1..b8229eceac326f2ee49e0b55a3ccc3995578561d 100644 (file)
@@ -1279,7 +1279,11 @@ static inline void zend_ssa_remove_phi_source(zend_ssa *ssa, zend_ssa_phi *phi,
        for (j = 0; j < predecessors_count; j++) {
                if (phi->sources[j] == var_num) {
                        if (j < pred_offset) {
-                               ZEND_ASSERT(phi->use_chains[pred_offset] == NULL);
+                               if (next_phi == NULL) {
+                                       next_phi = phi->use_chains[pred_offset];
+                               } else {
+                                       ZEND_ASSERT(phi->use_chains[pred_offset] == NULL);
+                               }
                        } else if (j >= pred_offset) {
                                phi->use_chains[j] = next_phi;
                        }
diff --git a/ext/opcache/tests/ssa_bug_010.phpt b/ext/opcache/tests/ssa_bug_010.phpt
new file mode 100644 (file)
index 0000000..1eadaa2
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Wrong assertion
+--FILE--
+<?php
+function foo($parts, $a, $b) {
+  $name = $a;
+  $level = 1;
+  foreach ($parts as $part) {
+    if ($level == 1) {
+      $level = 4;
+      $found = true;
+      switch ($part) {
+        case 'general':
+          break;
+        case 'bg':
+          $name = $b;
+          break;
+      }
+      if ($found) {
+        continue;
+      }
+    }
+    if ($level == 2) {
+      continue;
+    }
+  }
+  return $name;
+}
+?>
+OK
+--EXPECT--
+OK