mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
C++: Add test case with call in initialization
Fix formatting while here.
This commit is contained in:
@@ -49652,6 +49652,43 @@ try_except.c:
|
||||
# 40| Type = [IntType] int
|
||||
# 40| ValueCategory = prvalue(load)
|
||||
# 42| getStmt(2): [ReturnStmt] return ...
|
||||
# 44| [TopLevelFunction] int i()
|
||||
# 44| <params>:
|
||||
# 46| [TopLevelFunction] void j(int)
|
||||
# 46| <params>:
|
||||
# 46| getParameter(0): [Parameter] b
|
||||
# 46| Type = [IntType] int
|
||||
# 46| getEntryPoint(): [BlockStmt] { ... }
|
||||
# 47| getStmt(0): [DeclStmt] declaration
|
||||
# 47| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x
|
||||
# 47| Type = [IntType] int
|
||||
# 47| getVariable().getInitializer(): [Initializer] initializer for x
|
||||
# 47| getExpr(): [Literal] 0
|
||||
# 47| Type = [IntType] int
|
||||
# 47| Value = [Literal] 0
|
||||
# 47| ValueCategory = prvalue
|
||||
# 48| getStmt(1): [MicrosoftTryExceptStmt] __try { ... } __except( ... ) { ... }
|
||||
# 48| getStmt(): [BlockStmt] { ... }
|
||||
# 49| getStmt(0): [DeclStmt] declaration
|
||||
# 49| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y
|
||||
# 49| Type = [IntType] int
|
||||
# 49| getVariable().getInitializer(): [Initializer] initializer for y
|
||||
# 49| getExpr(): [FunctionCall] call to i
|
||||
# 49| Type = [IntType] int
|
||||
# 49| ValueCategory = prvalue
|
||||
# 51| getCondition(): [Literal] 1
|
||||
# 51| Type = [IntType] int
|
||||
# 51| Value = [Literal] 1
|
||||
# 51| ValueCategory = prvalue
|
||||
# 51| getExcept(): [BlockStmt] { ... }
|
||||
# 52| getStmt(0): [ExprStmt] ExprStmt
|
||||
# 52| getExpr(): [FunctionCall] call to sink
|
||||
# 52| Type = [VoidType] void
|
||||
# 52| ValueCategory = prvalue
|
||||
# 52| getArgument(0): [VariableAccess] x
|
||||
# 52| Type = [IntType] int
|
||||
# 52| ValueCategory = prvalue(load)
|
||||
# 54| getStmt(2): [ReturnStmt] return ...
|
||||
try_except.cpp:
|
||||
# 3| [TopLevelFunction] void ProbeFunction()
|
||||
# 3| <params>:
|
||||
|
||||
@@ -39194,6 +39194,31 @@ try_except.c:
|
||||
# 32| Block 7
|
||||
# 32| v32_10(void) = Unreached :
|
||||
|
||||
# 46| void j(int)
|
||||
# 46| Block 0
|
||||
# 46| v46_1(void) = EnterFunction :
|
||||
# 46| m46_2(unknown) = AliasedDefinition :
|
||||
# 46| m46_3(unknown) = InitializeNonLocal :
|
||||
# 46| m46_4(unknown) = Chi : total:m46_2, partial:m46_3
|
||||
# 46| r46_5(glval<int>) = VariableAddress[b] :
|
||||
# 46| m46_6(int) = InitializeParameter[b] : &:r46_5
|
||||
# 47| r47_1(glval<int>) = VariableAddress[x] :
|
||||
# 47| r47_2(int) = Constant[0] :
|
||||
# 47| m47_3(int) = Store[x] : &:r47_1, r47_2
|
||||
# 49| r49_1(glval<int>) = VariableAddress[y] :
|
||||
# 49| r49_2(glval<unknown>) = FunctionAddress[i] :
|
||||
# 49| r49_3(int) = Call[i] : func:r49_2
|
||||
# 49| m49_4(unknown) = ^CallSideEffect : ~m46_4
|
||||
# 49| m49_5(unknown) = Chi : total:m46_4, partial:m49_4
|
||||
# 49| m49_6(int) = Store[y] : &:r49_1, r49_3
|
||||
# 54| v54_1(void) = NoOp :
|
||||
# 46| v46_7(void) = ReturnVoid :
|
||||
# 46| v46_8(void) = AliasedUse : ~m49_5
|
||||
# 46| v46_9(void) = ExitFunction :
|
||||
|
||||
# 46| Block 1
|
||||
# 46| v46_10(void) = Unreached :
|
||||
|
||||
try_except.cpp:
|
||||
# 6| void f_cpp()
|
||||
# 6| Block 0
|
||||
@@ -39393,10 +39418,10 @@ try_except.cpp:
|
||||
#-----| True -> Block 1
|
||||
|
||||
# 48| Block 1
|
||||
# 48| r48_1(glval<int>) = VariableAddress[#throw48:13] :
|
||||
# 48| r48_2(int) = Constant[1] :
|
||||
# 48| m48_3(int) = Store[#throw48:13] : &:r48_1, r48_2
|
||||
# 48| v48_4(void) = ThrowValue : &:r48_1, m48_3
|
||||
# 48| r48_1(glval<int>) = VariableAddress[#throw48:7] :
|
||||
# 48| r48_2(int) = Constant[1] :
|
||||
# 48| m48_3(int) = Store[#throw48:7] : &:r48_1, r48_2
|
||||
# 48| v48_4(void) = ThrowValue : &:r48_1, m48_3
|
||||
#-----| C++ Exception -> Block 4
|
||||
|
||||
# 51| Block 2
|
||||
|
||||
@@ -21,6 +21,8 @@ lostReachability
|
||||
backEdgeCountMismatch
|
||||
useNotDominatedByDefinition
|
||||
| ir.cpp:1535:8:1535:8 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | ir.cpp:1535:8:1535:8 | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() |
|
||||
| try_except.c:51:13:51:13 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:46:6:46:6 | void j(int) | void j(int) |
|
||||
| try_except.c:51:13:51:13 | Left | Operand 'Left' is not dominated by its definition in function '$@'. | try_except.c:46:6:46:6 | void j(int) | void j(int) |
|
||||
switchInstructionWithoutDefaultEdge
|
||||
notMarkedAsConflated
|
||||
wronglyMarkedAsConflated
|
||||
|
||||
@@ -37470,6 +37470,65 @@ try_except.c:
|
||||
# 32| v32_9(void) = ReturnVoid :
|
||||
#-----| Goto -> Block 1
|
||||
|
||||
# 46| void j(int)
|
||||
# 46| Block 0
|
||||
# 46| v46_1(void) = EnterFunction :
|
||||
# 46| mu46_2(unknown) = AliasedDefinition :
|
||||
# 46| mu46_3(unknown) = InitializeNonLocal :
|
||||
# 46| r46_4(glval<int>) = VariableAddress[b] :
|
||||
# 46| mu46_5(int) = InitializeParameter[b] : &:r46_4
|
||||
# 47| r47_1(glval<int>) = VariableAddress[x] :
|
||||
# 47| r47_2(int) = Constant[0] :
|
||||
# 47| mu47_3(int) = Store[x] : &:r47_1, r47_2
|
||||
# 49| r49_1(glval<int>) = VariableAddress[y] :
|
||||
# 49| r49_2(glval<unknown>) = FunctionAddress[i] :
|
||||
# 49| r49_3(int) = Call[i] : func:r49_2
|
||||
# 49| mu49_4(unknown) = ^CallSideEffect : ~m?
|
||||
# 49| mu49_5(int) = Store[y] : &:r49_1, r49_3
|
||||
#-----| Goto -> Block 7
|
||||
|
||||
# 46| Block 1
|
||||
# 46| v46_6(void) = AliasedUse : ~m?
|
||||
# 46| v46_7(void) = ExitFunction :
|
||||
|
||||
# 46| Block 2
|
||||
# 46| v46_8(void) = Unwind :
|
||||
#-----| Goto -> Block 1
|
||||
|
||||
# 51| Block 3
|
||||
# 51| r51_1(int) = Constant[0] :
|
||||
# 51| r51_2(bool) = CompareEQ : r51_7, r51_1
|
||||
# 51| v51_3(void) = ConditionalBranch : r51_2
|
||||
#-----| False -> Block 4
|
||||
#-----| True -> Block 2
|
||||
|
||||
# 51| Block 4
|
||||
# 51| r51_4(int) = Constant[1] :
|
||||
# 51| r51_5(bool) = CompareEQ : r51_7, r51_4
|
||||
# 51| v51_6(void) = ConditionalBranch : r51_5
|
||||
#-----| True -> Block 6
|
||||
|
||||
# 51| Block 5
|
||||
# 51| r51_7(int) = Constant[1] :
|
||||
# 51| r51_8(int) = Constant[-1] :
|
||||
# 51| r51_9(bool) = CompareEQ : r51_7, r51_8
|
||||
# 51| v51_10(void) = ConditionalBranch : r51_9
|
||||
#-----| False -> Block 3
|
||||
#-----| True -> Block 2
|
||||
|
||||
# 52| Block 6
|
||||
# 52| r52_1(glval<unknown>) = FunctionAddress[sink] :
|
||||
# 52| r52_2(glval<int>) = VariableAddress[x] :
|
||||
# 52| r52_3(int) = Load[x] : &:r52_2, ~m?
|
||||
# 52| v52_4(void) = Call[sink] : func:r52_1, 0:r52_3
|
||||
# 52| mu52_5(unknown) = ^CallSideEffect : ~m?
|
||||
#-----| Goto -> Block 7
|
||||
|
||||
# 54| Block 7
|
||||
# 54| v54_1(void) = NoOp :
|
||||
# 46| v46_9(void) = ReturnVoid :
|
||||
#-----| Goto -> Block 1
|
||||
|
||||
try_except.cpp:
|
||||
# 6| void f_cpp()
|
||||
# 6| Block 0
|
||||
@@ -37682,10 +37741,10 @@ try_except.cpp:
|
||||
#-----| Goto -> Block 1
|
||||
|
||||
# 48| Block 3
|
||||
# 48| r48_1(glval<int>) = VariableAddress[#throw48:13] :
|
||||
# 48| r48_2(int) = Constant[1] :
|
||||
# 48| mu48_3(int) = Store[#throw48:13] : &:r48_1, r48_2
|
||||
# 48| v48_4(void) = ThrowValue : &:r48_1, ~m?
|
||||
# 48| r48_1(glval<int>) = VariableAddress[#throw48:7] :
|
||||
# 48| r48_2(int) = Constant[1] :
|
||||
# 48| mu48_3(int) = Store[#throw48:7] : &:r48_1, r48_2
|
||||
# 48| v48_4(void) = ThrowValue : &:r48_1, ~m?
|
||||
#-----| C++ Exception -> Block 6
|
||||
|
||||
# 51| Block 4
|
||||
|
||||
@@ -31,12 +31,24 @@ void AfxThrowMemoryException();
|
||||
|
||||
void h(int b) {
|
||||
int x = 0;
|
||||
__try {
|
||||
if (b) {
|
||||
AfxThrowMemoryException();
|
||||
}
|
||||
__try {
|
||||
if (b) {
|
||||
AfxThrowMemoryException();
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
}
|
||||
}
|
||||
|
||||
int i();
|
||||
|
||||
void j(int b) {
|
||||
int x = 0;
|
||||
__try {
|
||||
int y = i();
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,24 +31,24 @@ void AfxThrowMemoryException();
|
||||
|
||||
void h_cpp(int b) {
|
||||
int x = 0;
|
||||
__try {
|
||||
if (b) {
|
||||
AfxThrowMemoryException();
|
||||
}
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
__try {
|
||||
if (b) {
|
||||
AfxThrowMemoryException();
|
||||
}
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
}
|
||||
}
|
||||
|
||||
void throw_cpp(int b) {
|
||||
int x = 0;
|
||||
__try {
|
||||
if (b) {
|
||||
throw 1;
|
||||
}
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
__try {
|
||||
if (b) {
|
||||
throw 1;
|
||||
}
|
||||
}
|
||||
__except (1) {
|
||||
sink(x);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user