mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
regression test for former ASAN issue with script optimization of lambdas
This commit is contained in:
parent
693aa244f9
commit
e9971e31d5
1 changed files with 35 additions and 0 deletions
35
testing/btest/opt/regress-lambda-ASAN.zeek
Normal file
35
testing/btest/opt/regress-lambda-ASAN.zeek
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# @TEST-DOC: Regression test for lambda construction that used to violate memory safety
|
||||||
|
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
|
||||||
|
#
|
||||||
|
# It just needs to run without crashing. It generates a bunch of warnings but
|
||||||
|
# those aren't of interest here.
|
||||||
|
# @TEST-EXEC: zeek -b -O ZAM %INPUT
|
||||||
|
|
||||||
|
function g()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function gen0(f: function())
|
||||||
|
{
|
||||||
|
function[f]()
|
||||||
|
{
|
||||||
|
print f;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function genN(c: count)
|
||||||
|
{
|
||||||
|
switch c
|
||||||
|
{
|
||||||
|
case 0: gen0(g); break;
|
||||||
|
case 1: gen0(g); break;
|
||||||
|
case 2: gen0(g); break;
|
||||||
|
case 3: gen0(g); break;
|
||||||
|
case 4: gen0(g); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event zeek_init()
|
||||||
|
{
|
||||||
|
genN(3);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue