acpi-rs: fix 3 panic sites referencing non-existent .opcode field
OpInFlight has no `opcode` field (it has `op: Opcode`), and at the logical-op
site `result` was referenced inside its own initializer (not yet in scope).
All three defensive _ => panic! arms now use `op.op` with {:?} (Opcode derives
Debug; {:#x} was invalid for the fieldless enum anyway), matching the
Opcode::* arms they follow. Fixes E0425 + two E0609 that failed `cook base`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2013,7 +2013,7 @@ where
|
|||||||
Opcode::Or => left | right,
|
Opcode::Or => left | right,
|
||||||
Opcode::Nor => !(left | right),
|
Opcode::Nor => !(left | right),
|
||||||
Opcode::Xor => left ^ right,
|
Opcode::Xor => left ^ right,
|
||||||
_ => panic!("acpi: unknown binary maths opcode {:#x}", op.opcode),
|
_ => panic!("acpi: unknown binary maths opcode {:?}", op.op),
|
||||||
};
|
};
|
||||||
|
|
||||||
let result = Object::Integer(result).wrap();
|
let result = Object::Integer(result).wrap();
|
||||||
@@ -2057,7 +2057,7 @@ where
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => panic!("acpi: unknown unary maths opcode {:#x}", op.opcode),
|
_ => panic!("acpi: unknown unary maths opcode {:?}", op.op),
|
||||||
};
|
};
|
||||||
|
|
||||||
context.contribute_arg(Argument::Object(Object::Integer(result).wrap()));
|
context.contribute_arg(Argument::Object(Object::Integer(result).wrap()));
|
||||||
@@ -2131,7 +2131,7 @@ where
|
|||||||
Opcode::LEqual => left == right,
|
Opcode::LEqual => left == right,
|
||||||
Opcode::LGreater => left > right,
|
Opcode::LGreater => left > right,
|
||||||
Opcode::LLess => left < right,
|
Opcode::LLess => left < right,
|
||||||
_ => panic!("acpi: unknown logical opcode {:#x}", result.opcode),
|
_ => panic!("acpi: unknown logical opcode {:?}", op.op),
|
||||||
};
|
};
|
||||||
let result = if result { Object::Integer(u64::MAX) } else { Object::Integer(0) };
|
let result = if result { Object::Integer(u64::MAX) } else { Object::Integer(0) };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user