mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Fix error when log data wraps ring buffer
The offset wasn't being properly masked.
This commit is contained in:
@@ -95,11 +95,11 @@ logger::get_entry(uint64_t seen, void *buffer, size_t size)
|
||||
}
|
||||
|
||||
size_t off = m_start;
|
||||
j6_log_entry *ent = util::at<j6_log_entry>(m_buffer, off);
|
||||
j6_log_entry *ent = util::at<j6_log_entry>(m_buffer, offset(off));
|
||||
while (seen >= ent->id) {
|
||||
off += ent->bytes;
|
||||
kassert(off < m_end, "Got to the end while looking for new log entry");
|
||||
ent = util::at<j6_log_entry>(m_buffer, off);
|
||||
ent = util::at<j6_log_entry>(m_buffer, offset(off));
|
||||
}
|
||||
|
||||
if (size >= ent->bytes)
|
||||
|
||||
Reference in New Issue
Block a user