mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Merge remote-tracking branch 'origin/topic/vern/ZAM-const-prop-fix'
* origin/topic/vern/ZAM-const-prop-fix:
fix for error in ZAM's constant propagation logic
(cherry picked from commit 869bd181b2
)
This commit is contained in:
parent
59a1c74ac5
commit
a0d35d6e28
7 changed files with 74 additions and 12 deletions
2
testing/btest/Baseline/opt.regress-constant-prop/output
Normal file
2
testing/btest/Baseline/opt.regress-constant-prop/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
xyz
|
19
testing/btest/opt/regress-constant-prop.zeek
Normal file
19
testing/btest/opt/regress-constant-prop.zeek
Normal file
|
@ -0,0 +1,19 @@
|
|||
# @TEST-DOC: Regression test for incorrect constant propagation
|
||||
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
|
||||
# @TEST-EXEC: zeek -b -O ZAM %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
function foo(s: string)
|
||||
{
|
||||
if ( s == "foo" )
|
||||
s = "bar";
|
||||
else if ( s == "bar" )
|
||||
s = "bletch";
|
||||
|
||||
print s;
|
||||
}
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
foo("xyz");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue