File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
cpp/ql/test/library-tests/ir/ir Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -1798,6 +1798,23 @@ ir.c:
1798
1798
# 10| Type = [CTypedefType] MyCoords
1799
1799
# 10| ValueCategory = lvalue
1800
1800
# 11| getStmt(3): [ReturnStmt] return ...
1801
+ # 13| [TopLevelFunction] void CStyleCast(void*)
1802
+ # 13| <params>:
1803
+ # 13| getParameter(0): [Parameter] src
1804
+ # 13| Type = [VoidPointerType] void *
1805
+ # 14| getEntryPoint(): [BlockStmt] { ... }
1806
+ # 15| getStmt(0): [DeclStmt] declaration
1807
+ # 15| getDeclarationEntry(0): [VariableDeclarationEntry] definition of dst
1808
+ # 15| Type = [CharPointerType] char *
1809
+ # 15| getVariable().getInitializer(): [Initializer] initializer for dst
1810
+ # 15| getExpr(): [VariableAccess] src
1811
+ # 15| Type = [VoidPointerType] void *
1812
+ # 15| ValueCategory = prvalue(load)
1813
+ # 15| getExpr().getFullyConverted(): [CStyleCast] (char *)...
1814
+ # 15| Conversion = [PointerConversion] pointer conversion
1815
+ # 15| Type = [CharPointerType] char *
1816
+ # 15| ValueCategory = prvalue
1817
+ # 16| getStmt(1): [ReturnStmt] return ...
1801
1818
ir.cpp:
1802
1819
# 1| [TopLevelFunction] void Constants()
1803
1820
# 1| <params>:
Original file line number Diff line number Diff line change @@ -9,3 +9,10 @@ void MyCoordsTest(int pos) {
9
9
coords .x = coords .y = pos + 1 ;
10
10
coords .x = getX (& coords );
11
11
}
12
+
13
+ void CStyleCast (void * src )
14
+ {
15
+ char * dst = (char * )src ;
16
+ }
17
+
18
+ // semmle-extractor-options: --microsoft
Original file line number Diff line number Diff line change 978
978
| ir.c:10:19:10:25 | ChiTotal | total:m9_13 |
979
979
| ir.c:10:19:10:25 | SideEffect | ~m9_13 |
980
980
| ir.c:10:20:10:25 | Unary | r10_2 |
981
+ | ir.c:13:6:13:15 | ChiPartial | partial:m13_3 |
982
+ | ir.c:13:6:13:15 | ChiTotal | total:m13_2 |
983
+ | ir.c:13:6:13:15 | SideEffect | m13_3 |
984
+ | ir.c:13:23:13:25 | Address | &:r13_5 |
985
+ | ir.c:13:23:13:25 | Address | &:r13_5 |
986
+ | ir.c:13:23:13:25 | Address | &:r13_7 |
987
+ | ir.c:13:23:13:25 | Address | &:r13_7 |
988
+ | ir.c:13:23:13:25 | Load | m13_6 |
989
+ | ir.c:13:23:13:25 | SideEffect | m13_8 |
990
+ | ir.c:15:11:15:13 | Address | &:r15_1 |
991
+ | ir.c:15:17:15:26 | StoreValue | r15_4 |
992
+ | ir.c:15:24:15:26 | Address | &:r15_2 |
993
+ | ir.c:15:24:15:26 | Load | m13_6 |
994
+ | ir.c:15:24:15:26 | Unary | r15_3 |
981
995
| ir.cpp:1:6:1:14 | ChiPartial | partial:m1_3 |
982
996
| ir.cpp:1:6:1:14 | ChiTotal | total:m1_2 |
983
997
| ir.cpp:1:6:1:14 | SideEffect | m1_3 |
Original file line number Diff line number Diff line change @@ -766,6 +766,26 @@ ir.c:
766
766
# 7| v7_7(void) = AliasedUse : ~m?
767
767
# 7| v7_8(void) = ExitFunction :
768
768
769
+ # 13| void CStyleCast(void*)
770
+ # 13| Block 0
771
+ # 13| v13_1(void) = EnterFunction :
772
+ # 13| mu13_2(unknown) = AliasedDefinition :
773
+ # 13| mu13_3(unknown) = InitializeNonLocal :
774
+ # 13| r13_4(glval<void *>) = VariableAddress[src] :
775
+ # 13| mu13_5(void *) = InitializeParameter[src] : &:r13_4
776
+ # 13| r13_6(void *) = Load[src] : &:r13_4, ~m?
777
+ # 13| mu13_7(unknown) = InitializeIndirection[src] : &:r13_6
778
+ # 15| r15_1(glval<char *>) = VariableAddress[dst] :
779
+ # 15| r15_2(glval<void *>) = VariableAddress[src] :
780
+ # 15| r15_3(void *) = Load[src] : &:r15_2, ~m?
781
+ # 15| r15_4(char *) = Convert : r15_3
782
+ # 15| mu15_5(char *) = Store[dst] : &:r15_1, r15_4
783
+ # 16| v16_1(void) = NoOp :
784
+ # 13| v13_8(void) = ReturnIndirection[src] : &:r13_6, ~m?
785
+ # 13| v13_9(void) = ReturnVoid :
786
+ # 13| v13_10(void) = AliasedUse : ~m?
787
+ # 13| v13_11(void) = ExitFunction :
788
+
769
789
ir.cpp:
770
790
# 1| void Constants()
771
791
# 1| Block 0
You can’t perform that action at this time.
0 commit comments