Skip to content

Commit 3e6cf77

Browse files
Update cast to byte pointer getName()
1 parent 6acd877 commit 3e6cf77

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

cpp/common/src/codingstandards/cpp/rules/donotusepointerarithmetictoaddressdifferentarrays/DoNotUsePointerArithmeticToAddressDifferentArrays.qll

+1-8
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,7 @@ class CastedToBytePointer extends ArrayLikeAccess, Conversion {
8080

8181
override Element getElement() { result = this }
8282

83-
override string getName() {
84-
result = "cast to btye pointer " + this.toString()
85-
or
86-
exists(Cast cast |
87-
cast.getExpr() = this and
88-
result = cast.getType().(PointerType).getBaseType().toString()
89-
)
90-
}
83+
override string getName() { result = "cast to byte pointer" }
9184

9285
override int getSize() { result = size }
9386

cpp/common/test/rules/donotusepointerarithmetictoaddressdifferentarrays/DoNotUsePointerArithmeticToAddressDifferentArrays.expected

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
| test.cpp:11:8:11:11 | ... -- | Array pointer p7 points 1 element past the end of $@. | test.cpp:2:7:2:8 | l1 | l1 |
55
| test.cpp:12:8:12:9 | p3 | Array pointer p8 points 1 element past the end of $@. | test.cpp:2:7:2:8 | l1 | l1 |
66
| test.cpp:25:15:25:21 | & ... | Array pointer p14 points 1 element past the end of $@. | test.cpp:2:7:2:8 | l1 | l1 |
7-
| test.cpp:30:15:30:21 | & ... | Array pointer p17 points 1 element past the end of $@. | test.cpp:28:24:28:42 | (unsigned char *)... | cast to btye pointer (unsigned char *)... |
8-
| test.cpp:35:15:35:21 | & ... | Array pointer p20 points 1 element past the end of $@. | test.cpp:33:24:33:43 | (unsigned char *)... | cast to btye pointer (unsigned char *)... |
7+
| test.cpp:30:15:30:21 | & ... | Array pointer p17 points 1 element past the end of $@. | test.cpp:28:24:28:42 | (unsigned char *)... | cast to byte pointer |
8+
| test.cpp:35:15:35:21 | & ... | Array pointer p20 points 1 element past the end of $@. | test.cpp:33:24:33:43 | (unsigned char *)... | cast to byte pointer |

0 commit comments

Comments
 (0)