1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

Fixed segfault + ZTS

This commit is contained in:
Bob Weinand
2013-11-22 19:16:25 +01:00
parent c46a413697
commit 202c1cee39
3 changed files with 12 additions and 7 deletions
+4 -3
View File
@@ -28,7 +28,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
#define PHPDBG_FRAME(v) (PHPDBG_G(frame).v)
#define PHPDBG_EX(v) (EG(current_execute_data)->v)
void switch_to_frame(int frame) {
void switch_to_frame(int frame TSRMLS_DC) {
zend_execute_data *execute_data = PHPDBG_FRAME(num)?PHPDBG_FRAME(execute_data):EG(current_execute_data);
int i = 0;
@@ -52,7 +52,7 @@ void switch_to_frame(int frame) {
return;
}
restore_frame();
restore_frame(TSRMLS_C);
if (frame > 0) {
PHPDBG_FRAME(num) = frame;
@@ -63,6 +63,7 @@ void switch_to_frame(int frame) {
EG(opline_ptr) = &PHPDBG_EX(opline);
EG(active_op_array) = PHPDBG_EX(op_array);
PHPDBG_FRAME(execute_data)->original_return_value = EG(return_value_ptr_ptr);
EG(return_value_ptr_ptr) = PHPDBG_EX(original_return_value);
EG(active_symbol_table) = PHPDBG_EX(symbol_table);
EG(This) = PHPDBG_EX(current_this);
@@ -80,7 +81,7 @@ void switch_to_frame(int frame) {
);
}
void restore_frame() {
void restore_frame(TSRMLS_D) {
if (PHPDBG_FRAME(num) == 0) {
return;
}
+2 -2
View File
@@ -29,8 +29,8 @@ typedef struct {
zend_execute_data *execute_data;
} phpdbg_frame;
void switch_to_frame(int frame);
void switch_to_frame(int frame TSRMLS_DC);
void restore_frame();
void restore_frame(TSRMLS_D);
#endif /* PHPDBG_FRAME_H */
+6 -2
View File
@@ -376,7 +376,7 @@ PHPDBG_COMMAND(frame) /* {{{ */
{
switch (param->type) {
case NUMERIC_PARAM:
switch_to_frame(param->num);
switch_to_frame(param->num TSRMLS_CC);
break;
case EMPTY_PARAM:
@@ -1077,7 +1077,11 @@ last:
out:
phpdbg_destroy_input(&input TSRMLS_CC);
if (EG(in_execution)) {
restore_frame(TSRMLS_C);
}
PHPDBG_G(flags) &= ~PHPDBG_IS_INTERACTIVE;
return ret;