mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 15:23:27 +01:00
30 lines
567 B
Plaintext
30 lines
567 B
Plaintext
|
// Look for use of expressions with side-effects inside of debug logs.
|
||
|
//
|
||
|
// This script detects expressions like ++E, --E, E++, and E-- inside of
|
||
|
// calls to log_debug().
|
||
|
//
|
||
|
// The log_debug() macro exits early if debug logging is not enabled,
|
||
|
// potentially causing problems if its arguments have side-effects.
|
||
|
|
||
|
@@
|
||
|
expression E;
|
||
|
@@
|
||
|
*log_debug(... , <+... --E ...+>, ... );
|
||
|
|
||
|
|
||
|
@@
|
||
|
expression E;
|
||
|
@@
|
||
|
*log_debug(... , <+... ++E ...+>, ... );
|
||
|
|
||
|
@@
|
||
|
expression E;
|
||
|
@@
|
||
|
*log_debug(... , <+... E-- ...+>, ... );
|
||
|
|
||
|
|
||
|
@@
|
||
|
expression E;
|
||
|
@@
|
||
|
*log_debug(... , <+... E++ ...+>, ... );
|