Fixed #11181 (cppcheckdata.py: handle exception when ctu-info file is missing)
This commit is contained in:
parent
0d9bf03b5c
commit
514278e02b
|
@ -4443,6 +4443,7 @@ class MisraChecker:
|
||||||
def is_different_location(loc1, loc2):
|
def is_different_location(loc1, loc2):
|
||||||
return loc1['file'] != loc2['file'] or loc1['line'] != loc2['line']
|
return loc1['file'] != loc2['file'] or loc1['line'] != loc2['line']
|
||||||
|
|
||||||
|
try:
|
||||||
for filename in ctu_info_files:
|
for filename in ctu_info_files:
|
||||||
for line in open(filename, 'rt'):
|
for line in open(filename, 'rt'):
|
||||||
if not line.startswith('{'):
|
if not line.startswith('{'):
|
||||||
|
@ -4530,6 +4531,9 @@ class MisraChecker:
|
||||||
else:
|
else:
|
||||||
all_usage_files[s['name']] = [s['file']]
|
all_usage_files[s['name']] = [s['file']]
|
||||||
|
|
||||||
|
except FileNotFoundError:
|
||||||
|
return
|
||||||
|
|
||||||
for ti in all_typedef_info:
|
for ti in all_typedef_info:
|
||||||
if not ti['used']:
|
if not ti['used']:
|
||||||
self.reportError(Location(ti), 2, 3)
|
self.reportError(Location(ti), 2, 3)
|
||||||
|
|
Loading…
Reference in New Issue