From 6bfc38e61a67a308d7a4bfd03c544c5e93017e5e Mon Sep 17 00:00:00 2001 From: mttsner <42277794+mttsner@users.noreply.github.com> Date: Wed, 10 Jul 2024 02:00:17 +0300 Subject: [PATCH] Fix incorrect comment in Bytecode.h (#1315) The description of SUBRK/DIVRK is out of sync with the VM code. Comment: ```cpp // SUBRK, DIVRK: compute arithmetic operation between the constant and a source register and put the result into target register // A: target register // B: source register // C: constant table index (0..255); must refer to a number LOP_SUBRK, LOP_DIVRK, ``` VM snippet: ```cpp VM_CASE(LOP_DIVRK) { Instruction insn = *pc++; StkId ra = VM_REG(LUAU_INSN_A(insn)); TValue* kv = VM_KV(LUAU_INSN_B(insn)); StkId rc = VM_REG(LUAU_INSN_C(insn)); ... ``` --- Common/include/Luau/Bytecode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/include/Luau/Bytecode.h b/Common/include/Luau/Bytecode.h index 604b8b86e..1603d205f 100644 --- a/Common/include/Luau/Bytecode.h +++ b/Common/include/Luau/Bytecode.h @@ -360,8 +360,8 @@ enum LuauOpcode // SUBRK, DIVRK: compute arithmetic operation between the constant and a source register and put the result into target register // A: target register - // B: source register - // C: constant table index (0..255); must refer to a number + // B: constant table index (0..255); must refer to a number + // C: source register LOP_SUBRK, LOP_DIVRK,