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 <gabe.black@gmail.com> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -132,8 +132,8 @@ JobControl::updateJsState(uint16_t jobs)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user