com php-src: - Fix valgrind reports + CS: phpdbg.c phpdbg_lis t.c phpdbg_print.c
| From: | Bob Weinand | Date: | Mon, 18 Nov 2013 21:55:29 +0000 |
| Subject: | com php-src: - Fix valgrind reports + CS: phpdbg.c phpdbg_lis t.c phpdbg_print.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74828@lists.php.net to get a copy of this message | ||
Commit: 89514066787a1201bc4c4474cf78f21225ca412c
Author: Felipe Pena <felipensp@gmail.com> Mon, 18 Nov 2013 19:55:29 -0200
Parents: a1156cae5cd5e334a4225debfdf6141d97dd96ec
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=89514066787a1201bc4c4474cf78f21225ca412c
Log:
- Fix valgrind reports + CS
Changed paths:
M phpdbg.c
M phpdbg_list.c
M phpdbg_print.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index eaa626d..6659075 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -41,6 +41,7 @@ static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */
pg->lcmd = NULL;
pg->flags = PHPDBG_DEFAULT_FLAGS;
pg->oplog = NULL;
+ memset(&pg->lparam, 0, sizeof(phpdbg_param_t));
} /* }}} */
static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */
@@ -94,14 +95,14 @@ static void php_phpdbg_destroy_bp_condition(void *data) /* {{{ */
} /* }}} */
static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
-{
+{
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], 8, NULL, php_phpdbg_destroy_bp_file, 0);
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], 8, NULL, php_phpdbg_destroy_bp_symbol, 0);
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], 8, NULL, NULL, 0);
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], 8, NULL, php_phpdbg_destroy_bp_methods,
0);
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], 8, NULL, php_phpdbg_destroy_bp_condition,
0);
zend_hash_init(&PHPDBG_G(seek), 8, NULL, NULL, 0);
-
+
return SUCCESS;
} /* }}} */
@@ -113,7 +114,7 @@ static PHP_RSHUTDOWN_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(seek));
-
+
if (PHPDBG_G(exec)) {
efree(PHPDBG_G(exec));
PHPDBG_G(exec) = NULL;
diff --git a/phpdbg_list.c b/phpdbg_list.c
index dcce374..241983d 100644
--- a/phpdbg_list.c
+++ b/phpdbg_list.c
@@ -153,7 +153,7 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig
return;
}
- last_pos = mem = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
+ pos = last_pos = mem = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
end_pos = mem + st.st_size;
#else
@@ -170,7 +170,7 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig
return;
}
- last_pos = mem = (char*) MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
+ pos = last_pos = mem = (char*) MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
if (mem == NULL) {
phpdbg_error("Failed to map file in memory");
CloseHandle(map);
diff --git a/phpdbg_print.c b/phpdbg_print.c
index 606e091..f3821be 100644
--- a/phpdbg_print.c
+++ b/phpdbg_print.c
@@ -37,7 +37,8 @@ PHPDBG_PRINT(opline) /* {{{ */
return SUCCESS;
} /* }}} */
-static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) {
+static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) /* {{{ */
+{
switch (method->type) {
case ZEND_USER_FUNCTION: {
zend_op_array* op_array = &method->op_array;
@@ -85,7 +86,7 @@ static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC)
}
}
}
-}
+} /* }}} */
PHPDBG_PRINT(exec) /* {{{ */
{