switch assert to 'no file'

This commit is contained in:
kalsprite
2026-08-06 21:30:23 -07:00
parent a7c8a4b942
commit 678a7273b7

View File

@@ -265,8 +265,12 @@ gb_internal OdinDocPosition odin_doc_token_pos_cast(OdinDocWriter *w, TokenPos c
AstFile *file = global_files[pos.file_id];
if (file != nullptr) {
OdinDocFileIndex *file_index_found = map_get(&w->file_cache, file);
GB_ASSERT(file_index_found != nullptr);
file_index = *file_index_found;
// NOTE: a documented entity may hold a position in a file belonging to an
// imported package. Such files are only in file_cache when -all-packages is
// used, so fall back to the reserved "no file" index.
if (file_index_found != nullptr) {
file_index = *file_index_found;
}
}
}