]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorJoe Watkins <krakjoe@php.net>
Mon, 27 Feb 2017 17:55:14 +0000 (17:55 +0000)
committerJoe Watkins <krakjoe@php.net>
Mon, 27 Feb 2017 17:55:14 +0000 (17:55 +0000)
* PHP-7.0:
  fix crash in phpdbg shutdown process when opcache is loaded

1  2 
sapi/phpdbg/phpdbg.c

index 320c8afac67e1043a942338b13e31a568a59f8e3,37314e6183499cd90ff6faeb5a156ad072cb9a9c..121f1edb17fa2a57e6ccf3a97e6d0376da56921f
@@@ -231,20 -228,10 +231,19 @@@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /
        zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]);
        zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]);
        zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP]);
-       zend_hash_destroy(&PHPDBG_G(file_sources));
        zend_hash_destroy(&PHPDBG_G(seek));
        zend_hash_destroy(&PHPDBG_G(registered));
 -      zend_hash_destroy(&PHPDBG_G(watchpoints));
 -      zend_llist_destroy(&PHPDBG_G(watchlist_mem));
 +      phpdbg_destroy_watchpoints();
 +
 +      if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
 +              phpdbg_notice("stop", "type=\"normal\"", "Script ended normally");
 +      }
 +
 +      /* hack to restore mm_heap->use_custom_heap in order to receive memory leak info */
 +      if (use_mm_wrappers) {
 +              /* ASSUMING that mm_heap->use_custom_heap is the first element of the struct ... */
 +              *(int *) zend_mm_get_heap() = 0;
 +      }
  
        if (PHPDBG_G(buffer)) {
                free(PHPDBG_G(buffer));