Kernel: Fix undefined behavior due to shifting out of bounds

This commit is contained in:
Liav A 2021-03-18 17:51:27 +02:00 committed by Andreas Kling
parent b7d726e226
commit 314f04b896
Notes: sideshowbarker 2024-07-18 21:12:06 +09:00

View file

@ -485,7 +485,7 @@ public:
}
bool is_set(PortInterruptFlag flag) { return m_bitfield & (u32)flag; }
void set_at(PortInterruptFlag flag) { m_bitfield = m_bitfield | (1 << (u32)flag); }
void set_at(PortInterruptFlag flag) { m_bitfield = m_bitfield | static_cast<u32>(flag); }
void clear() { m_bitfield = 0; }
bool is_cleared() const { return m_bitfield == 0; }
void set_all() { m_bitfield = 0xffffffff; }