authorgravatar for dev@liujiacai.netJiacai Liu <dev@liujiacai.net> 2024-01-30 10:43:11+08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-01-29 21:43:11-05:00
log1b5cbf0d08d9d2fac1f17e4bcff916e4a179f080
tree533ab8dd5f258845574796f4b3879bca41ca13b7
parente460ba66a57f0a4e0ee07f32cef17c7f2bf290b4
signaturebadge-check Signed by PGP key B5690EEEBB952194

fix(autodoc): avoid panic when module not found (#18699)


1 files changed, 3 insertions(+), 1 deletions(-)

src/Autodoc.zig+3-1
......@@ -934,6 +934,8 @@ const AutodocErrors = error{
934934 OutOfMemory,
935935 CurrentWorkingDirectoryUnlinked,
936936 UnexpectedEndOfFile,
937 ModuleNotFound,
938 ImportOutsideModulePath,
937939} || std.fs.File.OpenError || std.fs.File.ReadError;
938940
939941/// `call` instructions will have loopy references to themselves
......@@ -1058,7 +1060,7 @@ fn walkInstruction(
10581060 );
10591061 }
10601062
1061 const new_file = self.zcu.importFile(file, path) catch unreachable;
1063 const new_file = try self.zcu.importFile(file, path);
10621064 const result = try self.files.getOrPut(self.arena, new_file.file);
10631065 if (result.found_existing) {
10641066 return DocData.WalkResult{