Skip to content

Commit

Permalink
Merge branch 'main' into am0o0-java-PathInjection
Browse files Browse the repository at this point in the history
  • Loading branch information
smowton authored Aug 5, 2024
2 parents 95e504a + 6f23819 commit e88bf31
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cpp/ql/test/library-tests/ir/ir/PrintAST.expected
Original file line number Diff line number Diff line change
Expand Up @@ -4179,6 +4179,40 @@ destructors_for_temps.cpp:
# 103| Type = [IntType] int
# 103| ValueCategory = prvalue
# 104| getStmt(1): [ReturnStmt] return ...
generic.c:
# 1| [TopLevelFunction] void c11_generic_test(unsigned int, int)
# 1| <params>:
# 1| getParameter(0): [Parameter] x
# 1| Type = [IntType] unsigned int
# 1| getParameter(1): [Parameter] y
# 1| Type = [IntType] int
# 1| getEntryPoint(): [BlockStmt] { ... }
# 2| getStmt(0): [DeclStmt] declaration
# 2| getDeclarationEntry(0): [VariableDeclarationEntry] definition of r
# 2| Type = [IntType] unsigned int
# 3| getStmt(1): [ExprStmt] ExprStmt
# 3| getExpr(): [AssignExpr] ... = ...
# 3| Type = [IntType] unsigned int
# 3| ValueCategory = prvalue
# 3| getLValue(): [VariableAccess] r
# 3| Type = [IntType] unsigned int
# 3| ValueCategory = lvalue
# 3| getRValue(): [AddExpr] ... + ...
# 3| Type = [IntType] unsigned int
# 3| ValueCategory = prvalue
# 3| getLeftOperand(): [VariableAccess] x
# 3| Type = [IntType] unsigned int
# 3| ValueCategory = prvalue(load)
# 3| getRightOperand(): [Literal] 1
# 3| Type = [IntType] int
# 3| Value = [Literal] 1
# 3| ValueCategory = prvalue
# 3| getRightOperand().getFullyConverted(): [CStyleCast] (unsigned int)...
# 3| Conversion = [IntegralConversion] integral conversion
# 3| Type = [IntType] unsigned int
# 3| Value = [CStyleCast] 1
# 3| ValueCategory = prvalue
# 4| getStmt(2): [ReturnStmt] return ...
ir.c:
# 5| [TopLevelFunction] int getX(MyCoords*)
# 5| <params>:
Expand Down
24 changes: 24 additions & 0 deletions cpp/ql/test/library-tests/ir/ir/aliased_ir.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2958,6 +2958,30 @@ destructors_for_temps.cpp:
# 102| v102_9(void) = AliasedUse : ~m103_26
# 102| v102_10(void) = ExitFunction :

generic.c:
# 1| void c11_generic_test(unsigned int, int)
# 1| Block 0
# 1| v1_1(void) = EnterFunction :
# 1| m1_2(unknown) = AliasedDefinition :
# 1| m1_3(unknown) = InitializeNonLocal :
# 1| m1_4(unknown) = Chi : total:m1_2, partial:m1_3
# 1| r1_5(glval<unsigned int>) = VariableAddress[x] :
# 1| m1_6(unsigned int) = InitializeParameter[x] : &:r1_5
# 1| r1_7(glval<int>) = VariableAddress[y] :
# 1| m1_8(int) = InitializeParameter[y] : &:r1_7
# 2| r2_1(glval<unsigned int>) = VariableAddress[r] :
# 2| m2_2(unsigned int) = Uninitialized[r] : &:r2_1
# 3| r3_1(glval<unsigned int>) = VariableAddress[x] :
# 3| r3_2(unsigned int) = Load[x] : &:r3_1, m1_6
# 3| r3_3(unsigned int) = Constant[1] :
# 3| r3_4(unsigned int) = Add : r3_2, r3_3
# 3| r3_5(glval<unsigned int>) = VariableAddress[r] :
# 3| m3_6(unsigned int) = Store[r] : &:r3_5, r3_4
# 4| v4_1(void) = NoOp :
# 1| v1_9(void) = ReturnVoid :
# 1| v1_10(void) = AliasedUse : m1_3
# 1| v1_11(void) = ExitFunction :

ir.c:
# 7| void MyCoordsTest(int)
# 7| Block 0
Expand Down
6 changes: 6 additions & 0 deletions cpp/ql/test/library-tests/ir/ir/generic.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
void c11_generic_test(unsigned int x, int y) {
unsigned int r;
r = _Generic(r, unsigned int: x, int: y) + 1;
}

// // semmle-extractor-options: -std=c11
23 changes: 23 additions & 0 deletions cpp/ql/test/library-tests/ir/ir/raw_ir.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,29 @@ destructors_for_temps.cpp:
# 102| v102_7(void) = AliasedUse : ~m?
# 102| v102_8(void) = ExitFunction :

generic.c:
# 1| void c11_generic_test(unsigned int, int)
# 1| Block 0
# 1| v1_1(void) = EnterFunction :
# 1| mu1_2(unknown) = AliasedDefinition :
# 1| mu1_3(unknown) = InitializeNonLocal :
# 1| r1_4(glval<unsigned int>) = VariableAddress[x] :
# 1| mu1_5(unsigned int) = InitializeParameter[x] : &:r1_4
# 1| r1_6(glval<int>) = VariableAddress[y] :
# 1| mu1_7(int) = InitializeParameter[y] : &:r1_6
# 2| r2_1(glval<unsigned int>) = VariableAddress[r] :
# 2| mu2_2(unsigned int) = Uninitialized[r] : &:r2_1
# 3| r3_1(glval<unsigned int>) = VariableAddress[x] :
# 3| r3_2(unsigned int) = Load[x] : &:r3_1, ~m?
# 3| r3_3(unsigned int) = Constant[1] :
# 3| r3_4(unsigned int) = Add : r3_2, r3_3
# 3| r3_5(glval<unsigned int>) = VariableAddress[r] :
# 3| mu3_6(unsigned int) = Store[r] : &:r3_5, r3_4
# 4| v4_1(void) = NoOp :
# 1| v1_8(void) = ReturnVoid :
# 1| v1_9(void) = AliasedUse : ~m?
# 1| v1_10(void) = ExitFunction :

ir.c:
# 7| void MyCoordsTest(int)
# 7| Block 0
Expand Down

0 comments on commit e88bf31

Please sign in to comment.