Skip to content

Commit

Permalink
Fix incorrect comment in Bytecode.h (#1315)
Browse files Browse the repository at this point in the history
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));
        ...
```
  • Loading branch information
mttsner authored Jul 9, 2024
1 parent f5a2c5d commit 6bfc38e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Common/include/Luau/Bytecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down

0 comments on commit 6bfc38e

Please sign in to comment.