]> granicus.if.org Git - php/commitdiff
Prevent segfault when no execution context set with "b <num>"
authorBob Weinand <bobwei9@hotmail.com>
Sun, 24 Nov 2013 12:03:00 +0000 (13:03 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Sun, 24 Nov 2013 12:03:00 +0000 (13:03 +0100)
phpdbg_prompt.c

index a2130653bf6359abb1dcfc6dc31a20e458f6f9c3..fb6b5bc37c79cafaba46b46ef618080d51d1093e 100644 (file)
@@ -775,7 +775,11 @@ PHPDBG_COMMAND(break) /* {{{ */
                        phpdbg_set_breakpoint_opline(param->addr TSRMLS_CC);
                        break;
                case NUMERIC_PARAM:
-                       phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC);
+                       if (PHPDBG_G(exec)) {
+                               phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC);
+                       } else {
+                               phpdbg_error("Execution context not set !");
+                       }
                        break;
                case METHOD_PARAM:
                        phpdbg_set_breakpoint_method(param->method.class, param->method.name TSRMLS_CC);