fix fuzz crash ty_anno_unexpected_token, handle EOF more gracefully

This commit is contained in:
Luke Boswell 2025-03-10 09:09:47 +11:00
parent f6ae028c6e
commit 35cd1e8dd9
No known key found for this signature in database
GPG key ID: 54A7324B1B975757
7 changed files with 65 additions and 22 deletions

View file

@ -119,9 +119,9 @@ fn generateObjectFile(
const suffix =
if (target.result.os.tag == std.Target.Os.Tag.windows)
"obj"
else
"o";
"obj"
else
"o";
const install = b.addInstallFile(obj_file, b.fmt("{s}.{s}", .{ object_name, suffix }));
const obj_step = b.step(step_name, "Build object file for linking");

View file

@ -517,9 +517,9 @@ pub fn listSwap(
const source_ptr = @as([*]u8, @ptrCast(newList.bytes));
swapElements(source_ptr, element_width, @as(usize,
// We already verified that both indices are less than the stored list length,
// which is usize, so casting them to usize will definitely be lossless.
@intCast(index_1)), @as(usize, @intCast(index_2)), copy);
// We already verified that both indices are less than the stored list length,
// which is usize, so casting them to usize will definitely be lossless.
@intCast(index_1)), @as(usize, @intCast(index_2)), copy);
return newList;
}