com php-src: fix crashes in newly introduced macros when normal trace is disabled but memory traced is enabled.: ext/mysqlnd/mysqlnd_d ebug.h
| From: | Andrey Hristov | Date: | Mon, 22 Oct 2012 12:35:35 +0000 |
| Subject: | com php-src: fix crashes in newly introduced macros when normal trace is disabled but memory traced is enabled.: ext/mysqlnd/mysqlnd_d ebug.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70443@lists.php.net to get a copy of this message | ||
Commit: 27e0999843f40efd3c9e725866ffb3a93b22c53f
Author: Andrey Hristov <andrey@php.net> Mon, 22 Oct 2012 14:35:35 +0200
Parents: 8219b02579097a1931ad63d4a863d854153fa64f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=27e0999843f40efd3c9e725866ffb3a93b22c53f
Log:
fix crashes in newly introduced macros when normal trace is disabled but
memory traced is enabled.
Changed paths:
M ext/mysqlnd/mysqlnd_debug.h
Diff:
diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index 272cdb2..37fbb80 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -96,10 +96,10 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC);
#define DBG_PROFILE_END_TIME(duration)
#endif
-#define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE)
(dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0)
-#define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE)
(dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0)
-#define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE)
(dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); }
while (0)
-#define DBG_ERR_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE)
(dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); }
while (0)
+#define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE && (dbg_obj))
(dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0)
+#define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE && (dbg_obj))
(dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0)
+#define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE && (dbg_obj))
(dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); }
while (0)
+#define DBG_ERR_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE && (dbg_obj))
(dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); }
while (0)
#define DBG_BLOCK_ENTER_EX(dbg_obj, block_name) DBG_BLOCK_ENTER_EX2((dbg_obj), NULL, (block_name))
#define DBG_BLOCK_LEAVE_EX(dbg_obj) DBG_BLOCK_LEAVE_EX2((dbg_obj))
@@ -124,7 +124,7 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC);
dbg_skip_trace = !(dbg_obj1)->m->func_enter((dbg_obj1), __LINE__, __FILE__, func_name,
strlen(func_name)); \
} \
if ((dbg_obj2)) { \
- dbg_skip_trace = !(dbg_obj2)->m->func_enter((dbg_obj2), __LINE__, __FILE__, func_name,
strlen(func_name)); \
+ dbg_skip_trace |= !(dbg_obj2)->m->func_enter((dbg_obj2), __LINE__, __FILE__, func_name,
strlen(func_name)); \
} \
if (dbg_skip_trace); /* shut compiler's mouth */\
do { \