Skip to content

Commit 2e06d6b

Browse files
committed
Fix crashing on expr 'var = {CLOBBER};', because location of such expression has NULL filename
1 parent 9a4b718 commit 2e06d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcc-c-api/gcc-location.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ GCC_IMPLEMENT_PUBLIC_API (int) gcc_location_get_column (gcc_location loc)
5454

5555
GCC_PUBLIC_API (bool) gcc_location_is_unknown (gcc_location loc)
5656
{
57-
return UNKNOWN_LOCATION == loc.inner;
57+
return UNKNOWN_LOCATION == loc.inner || !gcc_location_get_filename(loc);
5858
}
5959

6060
GCC_IMPLEMENT_PUBLIC_API (bool) gcc_location_get_in_system_header (gcc_location loc)

0 commit comments

Comments
 (0)