From: Stanislav Malyshev Date: Tue, 2 Jun 2015 05:55:16 +0000 (-0700) Subject: Merge branch 'PHP-5.6' X-Git-Tag: php-7.0.0alpha1~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75d16a4564d4bdb2991094d06b0529c47bd30ac3;p=php Merge branch 'PHP-5.6' * PHP-5.6: Fix bug #69737 - Segfault when SplMinHeap::compare produces fatal error Conflicts: ext/spl/spl_heap.c --- 75d16a4564d4bdb2991094d06b0529c47bd30ac3 diff --cc ext/spl/spl_heap.c index a92707bd93,3ff503a2a9..c4857663e7 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@@ -248,10 -246,13 +248,11 @@@ static void spl_ptr_heap_insert(spl_ptr heap->max_size *= 2; } - heap->ctor(elem TSRMLS_CC); - /* sifting up */ - for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) { - for(i = heap->count; i > 0 && heap->cmp(heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) { ++ for (i = heap->count; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) { heap->elements[i] = heap->elements[(i-1)/2]; } + heap->count++; if (EG(exception)) { /* exception thrown during comparison */