Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/45619 )
Change subject: base: Surround a DPRINTFS parameter in ()s.
......................................................................
base: Surround a DPRINTFS parameter in ()s.
Since DPRINTFS is a macro, its arguments need to be properly wrapped so
they expand as expected when used in expressions. This wasn't being done
for the s argument which was used as s->name(). If s contained some
other operator which had lower precedence than ->, the -> would happen
first to whatever was on the right hand side.
Change-Id: Id3250abb9ba51c4b0740f8de0d80ed730ba96944
---
M src/base/trace.hh
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/base/trace.hh b/src/base/trace.hh
index fff05f7..9e3984f 100644
--- a/src/base/trace.hh
+++ b/src/base/trace.hh
@@ -189,7 +189,7 @@
#define DPRINTFS(x, s, ...) do { \
if (GEM5_UNLIKELY(TRACING_ON && Debug::x)) { \
Trace::getDebugLogger()->dprintf_flag( \
- curTick(), s->name(), #x, __VA_ARGS__); \
+ curTick(), (s)->name(), #x, __VA_ARGS__); \
} \
} while (0)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45619
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id3250abb9ba51c4b0740f8de0d80ed730ba96944
Gerrit-Change-Number: 45619
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s