Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserdataTypes and Line Info Fix #46

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ local ttisstring = function(v) return type(v) == "string" end
local ttisboolean = function(v) return type(v) == "boolean" end
local ttisfunction = function(v) return type(v) == "function" end

local int_cast = function(n) return n % (2 ^ 32) end
SnorlaxAssist marked this conversation as resolved.
Show resolved Hide resolved

-- // opList contains information about the instruction, each instruction is defined in this format:
-- // {OP_NAME, OP_MODE, K_MODE, HAS_AUX}
-- // OP_MODE specifies what type of registers the instruction uses if any
Expand Down Expand Up @@ -472,14 +474,14 @@ local function luau_deserialize(bytecode, luau_settings)
local lastline = 0
for j = 1, intervals do
lastline += readWord()
abslineinfo[j] = lastline
abslineinfo[j] = int_cast(lastline)
SnorlaxAssist marked this conversation as resolved.
Show resolved Hide resolved
end

instructionlineinfo = table_create(sizecode)

for i = 1, sizecode do
--// p->abslineinfo[pc >> p->linegaplog2] + p->lineinfo[pc];
table_insert(instructionlineinfo, abslineinfo[bit32_rshift(i, linegaplog2) + 1] + lineinfo[i])
table_insert(instructionlineinfo, abslineinfo[bit32_rshift(i - 1, linegaplog2) + 1] + lineinfo[i])
end
end

Expand Down Expand Up @@ -527,7 +529,7 @@ local function luau_deserialize(bytecode, luau_settings)
local index = readByte()

while index ~= 0 do
readString()
readVarInt()

index = readByte()
end
Expand Down
Loading