Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/40954 )

Change subject: ext: Fix an operator precedence bug in the nomali library.
......................................................................

ext: Fix an operator precedence bug in the nomali library.

An expression in that library intended to create a bitmask by checking
if a bit should be set, and then using ?: to select between a bitmask
with that bit, or 0. Unfortunately | is higher precedence than ?:, and
so 0 would be |-ed with the condition of the next ?: instead. This CL
fixes the bug by adding some parenthesis.

Change-Id: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40954
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M ext/nomali/lib/jobcontrol.cc
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/ext/nomali/lib/jobcontrol.cc b/ext/nomali/lib/jobcontrol.cc
index 558cf3a..c62cd3d 100644
--- a/ext/nomali/lib/jobcontrol.cc
+++ b/ext/nomali/lib/jobcontrol.cc
@@ -132,8 +132,8 @@
     for (int i = 0; i < 16; ++i) {
         const JobSlot &slot(slots[i]);
         if (jobs & (1 << i)) {
-            js_state |= slot.active() ? (1 << i) : 0 |
-                slot.activeNext() ? (0x10000 << i) : 0;
+            js_state |= (slot.active() ? (1 << i) : 0) |
+                (slot.activeNext() ? (0x10000 << i) : 0);
         }
     }
     regs[RegAddr(JOB_IRQ_JS_STATE)] = js_state;



13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40954
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: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
Gerrit-Change-Number: 40954
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[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