File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import codingstandards.cpp.alertreporting.HoldsForAllCopies
22
22
23
23
class NonConstPointerVariableCandidate extends Variable {
24
24
NonConstPointerVariableCandidate ( ) {
25
+ // Ignore variables in functions that use ASM commands
26
+ not exists ( AsmStmt a | a .getEnclosingFunction ( ) = this .( LocalScopeVariable ) .getFunction ( ) ) and
25
27
// Avoid elements in macro expansions, as they cannot be equated across copies
26
28
not this .isInMacroExpansion ( ) and
27
29
exists ( PointerOrArrayType type |
Original file line number Diff line number Diff line change @@ -75,4 +75,13 @@ char *f16(char *p1) { // NON_COMPLIANT
75
75
int f17 (char * p1 ) { // NON_COMPLIANT
76
76
p1 ++ ;
77
77
return 0 ;
78
+ }
79
+
80
+ #include <stdint.h>
81
+
82
+ int16_t
83
+ test_r (int16_t * value ) { // COMPLIANT - ignored because of the use of ASM
84
+ int16_t result ;
85
+ __asm__("movb %bh (%eax)" );
86
+ return result ;
78
87
}
You can’t perform that action at this time.
0 commit comments