mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
ID/Stmt: Introduce INIT_SKIP and use in ForStmt
Currently, loop vars are added to a function scope's inits and initialized upon entering a function with default values. This applies to vector, record and table types. This is unnecessary for variables used in for loops as they are guaranteed to be initialized while iterating.
This commit is contained in:
parent
aaa81cae5d
commit
cea7c0ab46
7 changed files with 287 additions and 288 deletions
|
@ -1,19 +1,17 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
0, done parsing
|
||||
0, populating table, expecting 8 my_seq() invocations
|
||||
0, my_seq() invoked
|
||||
1, my_seq() invoked
|
||||
2, populating table, expecting 8 my_seq() invocations
|
||||
2, my_seq() invoked
|
||||
3, my_seq() invoked
|
||||
4, my_seq() invoked
|
||||
5, my_seq() invoked
|
||||
6, my_seq() invoked
|
||||
7, my_seq() invoked
|
||||
8, my_seq() invoked
|
||||
9, my_seq() invoked
|
||||
10, iterating table, expecting no my_seq() invocations
|
||||
10, it, [id=8], [id=7]
|
||||
10, it, [id=6], [id=5]
|
||||
10, it, [id=4], [id=3]
|
||||
10, it, [id=10], [id=9]
|
||||
10, done
|
||||
8, iterating table, expecting no my_seq() invocations
|
||||
8, it, [id=8], [id=7]
|
||||
8, it, [id=4], [id=3]
|
||||
8, it, [id=6], [id=5]
|
||||
8, it, [id=2], [id=1]
|
||||
8, done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue