This commit is contained in:
2026-04-29 18:11:26 +08:00
parent 260bea9ff1
commit 0ca5e8af92
8 changed files with 59 additions and 44 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ use fix_common::StringId;
use num_enum::TryFromPrimitive;
use string_interner::Symbol as _;
use crate::{OperandData, VmRuntimeCtx};
use crate::{AttrKeyData, OperandData, VmRuntimeCtx};
pub(crate) struct BytecodeReader<'a> {
bytecode: &'a [u8],
@@ -117,14 +117,14 @@ impl<'a> BytecodeReader<'a> {
}
#[inline(always)]
pub(crate) fn read_attr_key_data<C: VmRuntimeCtx>(&mut self, ctx: &C) -> crate::AttrKeyData {
pub(crate) fn read_attr_key_data(&mut self) -> crate::AttrKeyData {
use fix_codegen::AttrKeyType;
let tag = self.read_u8();
let ty = AttrKeyType::try_from_primitive(tag)
.unwrap_or_else(|err| panic!("unknown key tag: {:#04x}", err.number));
match ty {
AttrKeyType::Static => crate::AttrKeyData::Static(self.read_string_id()),
AttrKeyType::Dynamic => crate::AttrKeyData::Dynamic(self.read_operand_data(ctx)),
AttrKeyType::Static => AttrKeyData::Static(self.read_string_id()),
AttrKeyType::Dynamic => AttrKeyData::Dynamic,
}
}