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:
17981798# 10| Type = [CTypedefType] MyCoords
17991799# 10| ValueCategory = lvalue
18001800# 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 ...
18011818ir.cpp:
18021819# 1| [TopLevelFunction] void Constants()
18031820# 1| <params>:
Original file line number Diff line number Diff line change @@ -9,3 +9,10 @@ void MyCoordsTest(int pos) {
99 coords .x = coords .y = pos + 1 ;
1010 coords .x = getX (& coords );
1111}
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 978978| ir.c:10:19:10:25 | ChiTotal | total:m9_13 |
979979| ir.c:10:19:10:25 | SideEffect | ~m9_13 |
980980| 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 |
981995| ir.cpp:1:6:1:14 | ChiPartial | partial:m1_3 |
982996| ir.cpp:1:6:1:14 | ChiTotal | total:m1_2 |
983997| 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:
766766# 7| v7_7(void) = AliasedUse : ~m?
767767# 7| v7_8(void) = ExitFunction :
768768
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+
769789ir.cpp:
770790# 1| void Constants()
771791# 1| Block 0
You can’t perform that action at this time.
0 commit comments