Gabe Black has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45619
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/base/trace.hh
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



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: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to