Actually use given interrupt count.

This commit is contained in:
Florian Nücke
2020-12-29 18:58:34 +01:00
parent d0e581fb8a
commit 5a595d00d3

View File

@@ -1,7 +1,6 @@
package li.cil.oc2.common.vm;
import li.cil.oc2.api.bus.device.vm.InterruptAllocator;
import li.cil.sedna.riscv.device.R5PlatformLevelInterruptController;
import java.util.BitSet;
import java.util.OptionalInt;
@@ -45,7 +44,7 @@ public final class ManagedInterruptAllocator implements InterruptAllocator {
throw new IllegalStateException();
}
if (interrupt < 1 || interrupt >= R5PlatformLevelInterruptController.INTERRUPT_COUNT) {
if (interrupt < 1 || interrupt >= interruptCount) {
throw new IllegalArgumentException();
}