We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd07f27 commit b174b09Copy full SHA for b174b09
cpp/autosar/src/rules/A8-4-7/TriviallyCopyableSmallType.qll
@@ -12,11 +12,11 @@ int wordSize() { result = max(VoidPointerType v | | v.getSize()) }
12
* Converts bytes to words
13
*/
14
bindingset[bytes]
15
-int minWordsRequiredToRepresentBytes(int bytes) { result = (1.0*bytes / wordSize()).ceil() }
+int minWordsRequiredToRepresentBytes(int bytes) { result = (1.0 * bytes / wordSize()).ceil() }
16
17
class TriviallyCopyableSmallType extends Type {
18
TriviallyCopyableSmallType() {
19
isTriviallyCopyableType(this) and
20
- exists(int size | size = this.getSize() | bytesToWords(size) <= 2)
+ exists(int size | size = this.getSize() | minWordsRequiredToRepresentBytes(size) <= 2)
21
}
22
0 commit comments