com php-src: Fix phpdbg class fetch / method opcodes: sapi/phpdbg/phpdbg_print.c sapi/phpdbg/phpdbg_utils.c
| From: | Bob Weinand | Date: | Tue, 26 May 2015 22:55:26 +0000 |
| Subject: | com php-src: Fix phpdbg class fetch / method opcodes: sapi/phpdbg/phpdbg_print.c sapi/phpdbg/phpdbg_utils.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86939@lists.php.net to get a copy of this message | ||
Commit: 5bec1490f90e1061d4b3416c8e34a5369c616475
Author: Bob Weinand <bobwei9@hotmail.com> Wed, 27 May 2015 00:55:15 +0200
Parents: 7dac4d449f72d7eb029aa1a8ee87aaf38e17e1c5
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5bec1490f90e1061d4b3416c8e34a5369c616475
Log:
Fix phpdbg class fetch / method opcodes
Changed paths:
M sapi/phpdbg/phpdbg_print.c
M sapi/phpdbg/phpdbg_utils.c
Diff:
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 11bfdf5..4013c0f 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -282,12 +282,13 @@ void phpdbg_print_opcodes_function(const char *function, size_t len) {
}
void phpdbg_print_opcodes_method(const char *class, const char *function) {
- zend_class_entry *ce = zend_hash_str_find_ptr(EG(class_table), class, strlen(class));
+ zend_class_entry *ce;
zend_function *func;
- if (!ce) {
+ if (phpdbg_safe_class_lookup(class, strlen(class), &ce) != SUCCESS) {
return;
}
+
if (ce->type != ZEND_USER_CLASS) {
phpdbg_out("function name: %s::%s (internal)\n", class, function);
return;
@@ -348,7 +349,6 @@ void phpdbg_print_opcodes_class(const char *class) {
PHPDBG_API void phpdbg_print_opcodes(char *function)
{
char *method_name;
-
strtok(function, ":");
if (function == NULL) {
@@ -376,7 +376,7 @@ PHPDBG_API void phpdbg_print_opcodes(char *function)
} ZEND_HASH_FOREACH_END();
} else if ((method_name = strtok(NULL, ":")) == NULL) {
phpdbg_print_opcodes_function(function, strlen(function));
- } else if (++method_name == NULL || ++method_name == NULL) {
+ } else if ((method_name + 1) == NULL) {
phpdbg_print_opcodes_class(function);
} else {
phpdbg_print_opcodes_method(function, method_name);
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 9d63fcf..4cd8ce2 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -384,7 +384,7 @@ int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry
efree(str_name);
}
- return ce ? SUCCESS : FAILURE;
+ return *ce ? SUCCESS : FAILURE;
}
char *phpdbg_get_property_key(char *key) {