dev: Fix an assert in the I8259 interrupt controller.

If an *index* is equal to or greater than the size of the thing it's
indexing, then that's an error. Another count, on the other hand, must
be strictly greater for that to be a problem.

Change-Id: I9c891b37482fe72b6436850fc8c3c2fcef6f0476
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55585
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
This commit is contained in:
Gabe Black
2022-01-16 01:09:10 -08:00
parent 72a455f9c9
commit 2bbcee7723

View File

@@ -51,7 +51,7 @@ X86ISA::I8259::I8259(const Params &p)
}
int in_count = p.port_inputs_connection_count;
panic_if(in_count >= NumLines,
panic_if(in_count > NumLines,
"I8259 only supports 8 inputs, but there are %d.", in_count);
for (int i = 0; i < in_count; i++) {
inputs.push_back(new IntSinkPin<I8259>(