authorgravatar for garrettlennoxbeck@gmail.comGarrett Beck <garrettlennoxbeck@gmail.com> 2023-09-23 16:56:00-05:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-09-25 12:49:23+03:00
log8fab4f98c4ee511ba56fec2f38e2d80535c327a9
tree1e104b43bd8138c8b84e8cd7117d3345370ae9df
parent28ac9f8b704951010a49e33f405c4265bf3077d2

Prevent hitting a clang assert when dealing with FullSourceLoc


1 files changed, 5 insertions(+), 0 deletions(-)

src/zig_clang.cpp+5
...@@ -3053,6 +3053,11 @@ ZigClangASTUnit *ZigClangLoadFromCommandLine(const char **args_begin, const char...@@ -3053,6 +3053,11 @@ ZigClangASTUnit *ZigClangLoadFromCommandLine(const char **args_begin, const char
3053 msg->msg_len = msg_str_ref.size();3053 msg->msg_len = msg_str_ref.size();
30543054
3055 clang::FullSourceLoc fsl = it->getLocation();3055 clang::FullSourceLoc fsl = it->getLocation();
3056
3057 // Ensure the source location is valid before expanding it
3058 if (fsl.isInvalid()) {
3059 continue;
3060 }
3056 // Expand the location if possible3061 // Expand the location if possible
3057 fsl = fsl.getFileLoc();3062 fsl = fsl.getFileLoc();
30583063