mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
C++: Add pointer/pointee conflation test.
This commit is contained in:
@@ -922,4 +922,18 @@ namespace GlobalArrays {
|
||||
sink(global_pointer_static_indirect_2); // clean: global_pointer_static_indirect_2 does not have 2 indirections
|
||||
indirect_sink(global_pointer_static_indirect_2); // clean: global_pointer_static_indirect_2 does not have 2 indirections
|
||||
}
|
||||
}
|
||||
|
||||
namespace global_variable_conflation_test {
|
||||
int* global_pointer;
|
||||
|
||||
void def() {
|
||||
global_pointer = nullptr;
|
||||
*global_pointer = source();
|
||||
}
|
||||
|
||||
void use() {
|
||||
sink(global_pointer); // $ SPURIOUS: ir
|
||||
sink(*global_pointer); // $ ir MISSING: ast
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user