C++: Add testcase demonstrating missing local flow out of fields that are defined by reference.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-07-29 14:46:32 +02:00
parent d900fcaf42
commit a082172422
2 changed files with 16 additions and 0 deletions

View File

@@ -470,3 +470,15 @@ void viaOutparam() {
intOutparamSource(&x);
sink(x); // $ ast,ir
}
void writes_to_content(void*);
struct MyStruct {
int* content;
};
void local_field_flow_def_by_ref_steps_with_local_flow(MyStruct * s) {
writes_to_content(s->content);
int* p_content = s->content;
sink(*p_content);
}