Skip to content

Commit 114b468

Browse files
committed
update test
1 parent 93c485f commit 114b468

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
| test.cpp:27:5:27:6 | f1 | The variable $@ is used in this function but may not be initialized when it is called. | test.cpp:14:5:14:5 | b | b |
2+
| test.cpp:38:5:38:8 | main | The variable $@ is used in this function but may not be initialized when it is called. | test.cpp:14:5:14:5 | b | b |

cpp/ql/test/query-tests/Critical/GlobalUseBeforeInit/test.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ int f1()
3131
return 0;
3232
}
3333

34+
void f2() {
35+
my_printf("%d\n", b); // GOOD
36+
}
37+
3438
int main()
3539
{
36-
int b = f1();
40+
my_printf("%d\n", b); // BAD
41+
b = f1();
42+
f2();
3743
return 0;
3844
}

0 commit comments

Comments
 (0)