From 7eda0a8823a1287534d804d7ae75d8ae1ca8275c Mon Sep 17 00:00:00 2001 From: Justin Rainbow Date: Wed, 18 Jan 2012 15:56:29 -0700 Subject: [PATCH] PHP 5.3.2 segmentation fault fix For some reason, using the SqlFixedArray causes a Segmentation Fault during an install or update. Changing to a simple array fixes this issue, but in turn uses more memory. Which is why there is the version test. --- src/Composer/DependencyResolver/Solver.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/Solver.php b/src/Composer/DependencyResolver/Solver.php index 567df0273..c5c35acec 100644 --- a/src/Composer/DependencyResolver/Solver.php +++ b/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']) {