mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
Prevent hitting a clang assert when dealing with FullSourceLoc
This commit is contained in:
parent
28ac9f8b70
commit
8fab4f98c4
@ -3053,6 +3053,11 @@ ZigClangASTUnit *ZigClangLoadFromCommandLine(const char **args_begin, const char
|
||||
msg->msg_len = msg_str_ref.size();
|
||||
|
||||
clang::FullSourceLoc fsl = it->getLocation();
|
||||
|
||||
// Ensure the source location is valid before expanding it
|
||||
if (fsl.isInvalid()) {
|
||||
continue;
|
||||
}
|
||||
// Expand the location if possible
|
||||
fsl = fsl.getFileLoc();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user