mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
LibACPI: Make OpcodeFrame start point to right after the opcode
This makes some math later easier and less error prone since some opcodes have two bytes.
This commit is contained in:
1 parent
dbfa58bcbe
commit
3b0289a11c
2 files changed
+3
-4
No files matched your search
@@ -213,7 +213,7 @@ ErrorOr<void> Interpreter::finalize_term_opcode(OpcodeFrame& frame)
|
||||
auto path = TRY(frame.operand(1).as<NameString>());
|
||||
auto scope = TRY(find_node(path, m_scope_frames.last().scope()));
|
||||
|
||||
auto scope_frame = ScopeFrame(m_namespace_root, scope, frame.start(), frame.start() + length + 1, m_loaded_tables.size() - 1);
|
||||
auto scope_frame = ScopeFrame(m_namespace_root, scope, frame.start(), frame.start() + length, m_loaded_tables.size() - 1);
|
||||
TRY(m_scope_frames.try_append(scope_frame));
|
||||
return {};
|
||||
}
|
||||
@@ -314,7 +314,6 @@ ErrorOr<IterationDecision> Interpreter::cycle(TableStream& stream)
|
||||
|
||||
debug_print_header(stream);
|
||||
|
||||
auto start = stream.offset();
|
||||
if (is_namestring_start(TRY(stream.peek_byte()))) {
|
||||
auto name = TRY(stream.read_name_string());
|
||||
DEBUG_LOG("{}", name.to_string());
|
||||
@@ -334,7 +333,7 @@ ErrorOr<IterationDecision> Interpreter::cycle(TableStream& stream)
|
||||
|
||||
DEBUG_LOG("Opcode: {}", opcode);
|
||||
|
||||
auto opcode_frame = TRY(OpcodeFrame::from_opcode(static_cast<Opcode>(opcode), start));
|
||||
auto opcode_frame = TRY(OpcodeFrame::from_opcode(static_cast<Opcode>(opcode), stream.offset()));
|
||||
TRY(m_opcode_frames.try_append(move(opcode_frame)));
|
||||
m_state = State::ReadingOperand;
|
||||
return IterationDecision::Continue;
|
||||
|
||||
@@ -144,7 +144,7 @@ bool OpcodeFrame::check_repeat_opcodes(size_t current_offset)
|
||||
auto operand_type = m_operand_template[m_operand_template_index];
|
||||
|
||||
if (operand_type == OperandType::RepeatNextBytes) {
|
||||
if (current_offset >= m_start + m_counter.value() + 1) {
|
||||
if (current_offset >= m_start + m_counter.value()) {
|
||||
m_counter = {};
|
||||
m_operand_template_index += 2;
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user