Skip to content

Commit 7d1273d

Browse files
committed
csparser: extend the lists of key and black-listed events
1 parent 4201c23 commit 7d1273d

File tree

5 files changed

+199
-0
lines changed

5 files changed

+199
-0
lines changed

csparser.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ KeyEventDigger::KeyEventDigger():
221221
d(new Private)
222222
{
223223
// register checker-specific key events
224+
d->hMap["BAD_CHECK_OF_WAIT_COND"].insert("wait_cond_improperly_checked");
225+
d->hMap["BAD_LOCK_OBJECT"] .insert("boxed_lock");
226+
d->hMap["BAD_LOCK_OBJECT"] .insert("lock_on_assigned_field");
227+
d->hMap["BAD_LOCK_OBJECT"] .insert("single_thread_lock");
228+
d->hMap["CALL_SUPER"] .insert("missing_super_call");
224229
d->hMap["CHECKED_RETURN"] .insert("check_return");
225230
d->hMap["CONSTANT_EXPRESSION_RESULT"].insert("extra_high_bits");
226231
d->hMap["CONSTANT_EXPRESSION_RESULT"].insert("logical_vs_bitwise");
@@ -229,14 +234,20 @@ KeyEventDigger::KeyEventDigger():
229234
d->hMap["CONSTANT_EXPRESSION_RESULT"].insert("pointless_expression");
230235
d->hMap["CONSTANT_EXPRESSION_RESULT"].insert("result_independent_of_operands");
231236
d->hMap["CONSTANT_EXPRESSION_RESULT"].insert("same_on_both_sides");
237+
d->hMap["EXPLICIT_THIS_EXPECTED"].insert("implicit_this_used");
232238
d->hMap["FORWARD_NULL"] .insert("deref_parm");
233239
d->hMap["FORWARD_NULL"] .insert("dereference");
234240
d->hMap["FORWARD_NULL"] .insert("var_deref_op");
235241
d->hMap["FORWARD_NULL"] .insert("var_deref_model");
242+
d->hMap["NESTING_INDENT_MISMATCH"].insert("dangling_else");
243+
d->hMap["NESTING_INDENT_MISMATCH"].insert("multi_stmt_macro");
244+
d->hMap["NESTING_INDENT_MISMATCH"].insert("on_same_line");
245+
d->hMap["NESTING_INDENT_MISMATCH"].insert("uncle");
236246
d->hMap["ORDER_REVERSAL"] .insert("lock_acquire");
237247
d->hMap["OVERRUN_STATIC"] .insert("index_parm");
238248
d->hMap["OVERRUN_STATIC"] .insert("overrun-buffer-arg");
239249
d->hMap["OVERRUN_STATIC"] .insert("overrun-local");
250+
d->hMap["STREAM_FORMAT_STATE"] .insert("format_changed");
240251
d->hMap["UNINIT"] .insert("uninit_use");
241252
d->hMap["UNINIT"] .insert("uninit_use_in_call");
242253
d->hMap["UNINIT_CTOR"] .insert("uninit_member");
@@ -259,7 +270,13 @@ KeyEventDigger::KeyEventDigger():
259270
d->hMap["LOCK"];
260271

261272
// events that should never be used as key events (excluding trace events)
273+
d->blackList.insert("another_instance");
274+
d->blackList.insert("comparison_remediation");
275+
d->blackList.insert("example_access");
276+
d->blackList.insert("example_comparison");
277+
d->blackList.insert("example_lock");
262278
d->blackList.insert("remediation");
279+
d->blackList.insert("rounding_remediation");
263280

264281
// trace events
265282
d->traceEvts.insert("break");

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ test_csgrep(csgrep "40-csparser-code-snippet" )
150150
test_csgrep(csgrep "41-gcc-parser-pylint" )
151151
test_csgrep(csgrep "42-gcc-parser-smatch" )
152152
test_csgrep(csgrep "43-gcc-parser-smatch" )
153+
test_csgrep(csgrep "44-csparser-new-key-evts" )
153154
test_csparser(csparser-5.8 00)
154155
test_csparser(csparser-5.8 01)
155156
test_csparser(csparser-5.8 02)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--prune-events=0

0 commit comments

Comments
 (0)