removed order-of-evaluation ambiguity from new BTest

This commit is contained in:
Vern Paxson 2023-09-27 11:36:22 -07:00
parent 434a7e059d
commit 3addda28d3

View file

@ -80,10 +80,18 @@ global tbl: table[R] of R;
{ {
print seq, "populating table, expecting 8 my_seq() invocations"; print seq, "populating table, expecting 8 my_seq() invocations";
tbl[R()] = R(); # The following structure is used to avoid order-of-evaluation
tbl[R()] = R(); # ambiguity. If we use "tbl[R()] = R()" statements then script
tbl[R()] = R(); # optimization might create different table indices/values than
tbl[R()] = R(); # interpreted execution.
local v = R();
tbl[R()] = v;
v = R();
tbl[R()] = v;
v = R();
tbl[R()] = v;
v = R();
tbl[R()] = v;
print seq, "iterating table, expecting no my_seq() invocations"; print seq, "iterating table, expecting no my_seq() invocations";
for ( [r1], r2 in tbl ) for ( [r1], r2 in tbl )