Explorar o código

Merge pull request #226 from justinrainbow/bug_211

PHP 5.3.2 segmentation fault fix
Jordi Boggiano %!s(int64=13) %!d(string=hai) anos
pai
achega
f6efa3aa24
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/Composer/DependencyResolver/Solver.php

+ 5 - 1
src/Composer/DependencyResolver/Solver.php

@@ -937,7 +937,11 @@ class Solver
             $this->installedMap[$package->getId()] = $package;
         }
 
-        $this->decisionMap = new \SplFixedArray($this->pool->getMaxId() + 1);
+        if (version_compare(PHP_VERSION, '5.3.2', '>')) {
+            $this->decisionMap = new \SplFixedArray($this->pool->getMaxId() + 1);
+        } else {
+            $this->decisionMap = array_fill(0, $this->pool->getMaxId() + 1, 0);
+        }
 
         foreach ($this->jobs as $job) {
             switch ($job['cmd']) {