Skip to content

Commit e3b70fa

Browse files
committed
gcc-parser: assign per-checker language attribute
1 parent d219792 commit e3b70fa

6 files changed

+855
-0
lines changed

gcc-parser.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ class PostProcessor {
550550
private:
551551
const boost::regex reGccAnalCoreEvt_;
552552
const boost::regex reGccAnalCwe_;
553+
const LangDetector langDetector_;
553554

554555
void transGccAnal(Defect *pDef);
555556
};
@@ -575,6 +576,7 @@ void PostProcessor::transGccAnal(Defect *pDef) {
575576

576577
void PostProcessor::apply(Defect *pDef) {
577578
this->transGccAnal(pDef);
579+
this->langDetector_.inferLangFromChecker(pDef);
578580
}
579581

580582
struct GccParser::Private {

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ test_csgrep(csgrep "59-json-parser-cov-v7-cwe" )
179179
test_csgrep(csgrep "60-gcc-parser-cppcheck-cwe" )
180180
test_csgrep(csgrep "61-json-parser-cov-v7-lang" )
181181
test_csgrep(csgrep "62-csparser-checker-lang" )
182+
test_csgrep(csgrep "63-gcc-parser-checker-lang" )
182183
test_csparser(csparser-5.8 00)
183184
test_csparser(csparser-5.8 01)
184185
test_csparser(csparser-5.8 02)

0 commit comments

Comments
 (0)