diff --git a/runtime/luau.lua b/runtime/luau.lua index bab1e50..8a9a8fc 100644 --- a/runtime/luau.lua +++ b/runtime/luau.lua @@ -39,8 +39,8 @@ local function rip_u64(x) return math.floor(x / 0x100000000), x % 0x100000000 en local function merge_u64(hi, lo) return hi * 0x100000000 + lo end local function clear_byte(value, offset) - offset *= 8; - return bit32.band(value, bit32.bnot(bit32.lshift(0xFF, offset))); + offset *= 8 + return bit32.band(value, bit32.bnot(bit32.lshift(0xFF, offset))) end local function load_byte(memory, addr) @@ -51,7 +51,7 @@ end local function store_byte(memory, addr, value) local offset = addr % 4 local base = (addr - offset) / 4 - local old = clear_byte(memory.data[base] or 0, offset); + local old = clear_byte(memory.data[base] or 0, offset) memory.data[base] = bit32.bor(old, bit32.lshift(value, 8 * offset)) end @@ -155,7 +155,7 @@ function store.i32(memory, addr, value) end function store.i32_n8(memory, addr, value) - store.i32(memory, addr, bit32.band(value, 0xFF)) + store_byte(memory, addr, bit32.band(value, 0xFF)) end function store.i64(memory, addr, value)