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:
Arne Welzel 2025-07-07 18:13:44 +02:00 committed by Tim Wojtulewicz
parent 59a1c74ac5
commit a0d35d6e28
7 changed files with 74 additions and 12 deletions

View 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

View 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");
}