Skip to content

Commit

Permalink
fix: tl types: never trigger ICE on bad files
Browse files Browse the repository at this point in the history
This matches the behavior of master.

Can't make a simple regression test for this one because that
would be dependent on unspecified behaviors of the parser and
type-checker.

Fixes #795.
  • Loading branch information
hishamhm committed Aug 26, 2024
1 parent 433d716 commit 59ad305
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tl
Original file line number Diff line number Diff line change
Expand Up @@ -898,13 +898,11 @@ do
env.report_types = true

for i, input_file in ipairs(args["file"]) do
local pok, perr, err = pcall(process_module, input_file, env)
if not pok then
die("Internal Compiler Error: " .. perr)
end
if err then
printerr(err)
end
-- we run the type-checker even on files that produce
-- syntax errors; this means we run it on incomplete and
-- potentially inconsistent trees which may crash the
-- type-checker; hence, we wrap it with a pcall here.
pcall(process_module, input_file, env)

check_collect(i)
end
Expand Down

0 comments on commit 59ad305

Please sign in to comment.