Skip to content

Commit 60494fd

Browse files
committed
CPP: Subtle test case.
1 parent 2ef3cc3 commit 60494fd

File tree

1 file changed

+17
-0
lines changed
  • cpp/ql/test/query-tests/Critical/LargeParameter

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,20 @@ MyArithmeticClass operator+(MyArithmeticClass lhs, const MyArithmeticClass &rhs)
147147
}
148148

149149
void myFunction6(MyLargeClass a); // GOOD (no definition, so we can't tell what's done with `a`)
150+
151+
// ---
152+
153+
struct big
154+
{
155+
int xs[800];
156+
int *ptr;
157+
};
158+
159+
void myFunction7(
160+
big a, // GOOD
161+
big b // BAD [NOT DETECTED]
162+
)
163+
{
164+
a.xs[0]++; // modifies a
165+
b.ptr[0]++; // does not modify b
166+
}

0 commit comments

Comments
 (0)