Skip to content

Commit 671d17d

Browse files
committed
Fix shared query problems predicate format
1 parent e017d52 commit 671d17d

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

cpp/common/src/codingstandards/cpp/rules/bitfieldsshouldnotbedeclared/BitFieldsShouldNotBeDeclared.qll

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,17 @@ signature module BitFieldsShouldNotBeDeclaredConfigSig {
1717
}
1818

1919
module BitFieldsShouldNotBeDeclared<BitFieldsShouldNotBeDeclaredConfigSig Config> {
20-
query predicate problems(
21-
BitField bf, Class c, string message, Class linkLocation, string linkDescription
22-
) {
20+
query predicate problems(BitField bf, string message, Class linkLocation, string linkDescription) {
2321
/*
2422
* The condition that is allowed that is IF this is a bit-field, then it should be part of a class
2523
* that is flagged as a hardware or protocol class. To detect this we look for violations of that form.
2624
*/
2725

2826
not isExcluded(bf, Config::getQuery()) and
29-
not isExcluded(c, Config::getQuery()) and
30-
bf = c.getAField() and
31-
linkLocation = c and
32-
linkDescription = c.getName() and
33-
not c instanceof HardwareOrProtocolInterfaceClass and
27+
not isExcluded(linkLocation, Config::getQuery()) and
28+
bf = linkLocation.getAField() and
29+
linkDescription = linkLocation.getName() and
30+
not linkLocation instanceof HardwareOrProtocolInterfaceClass and
3431
message = "Bit-field used within a class $@ that is not a hardware or protocol class."
3532
}
3633
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cpp:57:8:57:8 | c | test.cpp:53:7:53:8 | B2 | Bit-field used within a class $@ that is not a hardware or protocol class. | test.cpp:53:7:53:8 | B2 | B2 |
1+
| test.cpp:57:8:57:8 | c | Bit-field used within a class $@ that is not a hardware or protocol class. | test.cpp:53:7:53:8 | B2 | B2 |

0 commit comments

Comments
 (0)