Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielsferre committed Jul 22, 2024
1 parent 7e924a2 commit ef32c2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/pallene/gc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ local function flow_analysis(block_list, state_list)
end

for v, g in pairs(gen) do
assert(g ~= true or g ~= kill[v], "gen and kill can't both be true")
assert(not (g and kill[v]), "gen and kill can't both be true")
local previous_val = input[v]
local new_val = true
input[v] = new_val
Expand All @@ -102,7 +102,7 @@ local function flow_analysis(block_list, state_list)
end
end

local function empty_set(S)
local function clear_set(S)
for v,_ in pairs(S) do
S[v] = nil
end
Expand All @@ -124,7 +124,7 @@ local function flow_analysis(block_list, state_list)

-- last block's output is supposed to be fixed
if block_i ~= #block_list then
empty_set(state.output)
clear_set(state.output)
for _,succ in ipairs(block_succs) do
local succ_in = state_list[succ].input
merge_live(succ_in, state.output)
Expand All @@ -146,7 +146,7 @@ local function flow_analysis(block_list, state_list)
found_dirty_block = true
-- CAREFUL: we have to clean the dirty flag BEFORE updating the block or else we
-- will do the wrong thing for auto-referencing blocks
dirty_flag[block_i] = nil
dirty_flag[block_i] = false
update_block(block_i)
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/pallene/uninitialized.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ local function flow_analysis(block_list, state_list)
end
end

local function empty_set(S)
local function clear_set(S)
for v,_ in pairs(S) do
S[v] = nil
end
Expand All @@ -102,7 +102,7 @@ local function flow_analysis(block_list, state_list)

-- first block's input is supposed to be fixed
if block_i ~= 1 then
empty_set(state.input)
clear_set(state.input)
for _,pred in ipairs(block_preds) do
local pred_out = state_list[pred].output
merge_uninit(state.input, pred_out)
Expand All @@ -124,7 +124,7 @@ local function flow_analysis(block_list, state_list)
found_dirty_block = true
-- CAREFUL: we have to clean the dirty flag BEFORE updating the block or else we
-- will do the wrong thing for auto-referencing blocks
dirty_flag[block_i] = nil
dirty_flag[block_i] = false
update_block(block_i)
end
end
Expand Down

0 comments on commit ef32c2d

Please sign in to comment.