]> granicus.if.org Git - php/commitdiff
Fix infinite recursion issues (segfaults)
authorBob Weinand <bobwei9@hotmail.com>
Sun, 5 Oct 2014 11:29:56 +0000 (13:29 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Sun, 5 Oct 2014 11:29:56 +0000 (13:29 +0200)
phpdbg_prompt.c

index 9c24e943637f2f7badda8db3f6f52e5cd721330b..a72292eb56a6bdee330c4cc7f009c72daf02e13f 100644 (file)
@@ -1248,7 +1248,12 @@ next:
 
                PHPDBG_G(last_line) = execute_data->opline->lineno;
 
+               /* stupid hack to make zend_do_fcall_common_helper return ZEND_VM_ENTER() instead of recursively calling zend_execute() and eventually segfaulting */
+               if ((execute_data->opline->opcode == ZEND_DO_FCALL_BY_NAME || execute_data->opline->opcode == ZEND_DO_FCALL) && execute_data->function_state.function->type == ZEND_USER_FUNCTION) {
+                       zend_execute_ex = execute_ex;
+               }
                PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC);
+               zend_execute_ex = phpdbg_execute_ex;
 
                if (PHPDBG_G(vmret) > 0) {
                        switch (PHPDBG_G(vmret)) {