mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: Add a test that demonstrates reference dereference duplication.
This commit is contained in:
@@ -836,4 +836,14 @@ namespace MoreGlobalTests {
|
||||
sink(global_direct); // $ ir MISSING: ast
|
||||
indirect_sink(global_direct); // clean
|
||||
}
|
||||
}
|
||||
|
||||
void test_references() {
|
||||
int x = source();
|
||||
int &y = x;
|
||||
sink(y); // $ ast,ir
|
||||
|
||||
int* px = indirect_source();
|
||||
int*& rpx = px;
|
||||
indirect_sink((int*)rpx); // $ ast,ir
|
||||
}
|
||||
Reference in New Issue
Block a user