diff --git a/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py b/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py index 8040d3b7ff..d7b42b3a65 100644 --- a/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py +++ b/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py @@ -59,13 +59,12 @@ def postprocess_result(self, skip_handlers: Optional[SkipListHandlers]): into the database. """ LOG.debug_analyzer(self.analyzer_stdout) - gcc_output_file = self.analyzed_source_file + ".sarif" + file_name = os.path.basename(self.analyzed_source_file) + gcc_output_file = \ + str(Path(self.buildaction.directory, file_name)) + ".sarif" - # Gcc doesn't create any files when there are no diagnostics. - # Unfortunately, we can't tell whethet the file missing was because of - # that or some other error, we need to bail out here. - if not os.path.exists(gcc_output_file): - return + assert os.path.exists(gcc_output_file), \ + "Faile to find the sarif file for GCC analysis!" reports = report_file.get_reports( gcc_output_file, self.checker_labels,