From bc10307e0a01eb28e272b94297cbfaf35034c746 Mon Sep 17 00:00:00 2001 From: chentianya Date: Wed, 26 Aug 2026 10:20:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B6=E6=AE=B54-3=EF=BC=9Aexecutor=20V2=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=EF=BC=88cur=5Finstr=5Fbytes/slot=5Faddr?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=20V1=20=E5=AE=9A=E5=AE=BD=E6=A7=BD=E6=AE=8B?= =?UTF-8?q?=E7=95=99=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- executor/src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/executor/src/main.cpp b/executor/src/main.cpp index f746c89..d3c901f 100644 --- a/executor/src/main.cpp +++ b/executor/src/main.cpp @@ -129,7 +129,7 @@ namespace { * @return 低字节非零 → 1,否则 0 */ int slot_bool(vm::Machine& m, uint32_t slot) { - return m.data()[static_cast(slot) * 8] ? 1 : 0; + return m.data()[m.slot_addr(slot)] ? 1 : 0; } /** @@ -139,7 +139,7 @@ namespace { * @param v 0/1(非零归一化为 1) */ void put_bool(vm::Machine& m, uint32_t slot, int v) { - m.data()[static_cast(slot) * 8] = v ? 1 : 0; + m.data()[m.slot_addr(slot)] = v ? 1 : 0; } /** @@ -301,7 +301,7 @@ int main(int argc, char** argv) { uint32_t guard = 0; while (machine.fault() == vm::Fault::None && !machine.ended()) { char buf[64]; - isa::disasm(machine.cur_instr(), buf, sizeof buf); + isa::disasm(machine.cur_instr_bytes(), machine.cur_instr_len(), buf, sizeof buf); const uint32_t pc = machine.pc(); const uint32_t fn = machine.fn_id(); if (!machine.step()) {