rpg_shape.zig: an IF with an empty body is its own boundary (touches rpg_statements.zig) #758
Loading…
Reference in a new issue
No description provided.
Delete branch "lcf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rpg_shape.zig: an IF with an empty body is its own boundary (touches rpg_statements.zig)
Predicted mechanism (written before the rule).
if R.m = 'Y'; endif;(SC-ILE/EXPERIMENTS lcf-cond1, thedictionary battery dict-cond1, statement 18) stopped at control_flow / condition_boundary on the false
label and at value_flow / operation_semantics on operation 33. Operation 33 (
33 256; 27 431; 62; 32 256 0 3, the address of the data structure plus the subfield offset) was not the cause: the sameread recovers as
WHEN S256.10 = 'Y'in the SELECT of the same program. A condition statement thatthe shape cannot give a boundary falls back to its raw operations, and the first operation without a
value rule, the pushed address, is then reported. The cause is the boundary:
forwardBoundaryaccepts thelabel when the next statement is the ENDIF marker (a codeless statement).
15 329 2) at theend of the IF statement itself, and the ENDIF marker follows.
conditionBoundarylooks only at laterstatements, so the IF was refused, then the marker was read as the opener of a SELECT, and the block
after it as a WHEN: every statement after the first empty IF of the program was wrong.
Rule (
rpg_shape.ownBoundary): a condition statement is its own boundary when it defines the false labelof its condition jump, that jump is the only edge to the label in the procedure graph, and the next
statement is codeless. The IF then opens as usual and the existing ENDIF logic closes it at the marker.
The hook in
rpg_statements.renderConditionreplaces a line (net zero lines inrpg_statements.zig).Result on the battery: all 26 statements of dict-cond1 emit with 0 failures (
if,dow,dou,select/whenwith a subfield of a qualified data structure, an indicator subfield, AND, NOT,*BLANKS);2 statements stay partial at type_inference / decimal_positions (
R.n = 3, zoned). Test:src/rpg_empty_if_test.zig(red on trunk1e322e1e, green here; mutations that add a second jump to the labelor make the marker not codeless refuse the IF).
Measured state of the other twins (no rule)
lr1-di-pk3,-pk5,-pk5-sub,-zd4: recovered since v0.1.462 byf8d81c5f(decimal-index FOR); thev0.1.459 leads are stale.
FLOW/lx-total: the cycle end proof (rpg_cycle.totals) requires18 Lright after the*TOTCPSDSstore; the total calculation between them leaves
detailEndnull, which gives both block_owner stops.rpg_loop_exits_test.zigpins that refusal. Not changed here.MONITOR/limits: nested monitors and selected handlers (monitor_boundaries), partial by design.Probe
lcf-cond1(dictionary capture dict-cond1).lcf-qc-* battery (24 programs, qualified subfield in IF, WHEN, DOW, DOU, AND, OR, nested IF, ELSE, ELSEIF)
With this change none of the 24 stops at control_flow. Without it only
empty-c3andempty-plain(a plain field, no data structure) do, so the cause is the empty body and not the subfield read. The other
stops are not control flow: a packed or zoned subfield compared with a literal stops at type_inference /
decimal_positions (
if-p0,if-p3,if-z0,if-z3,and-cz,or-cp,nested: a family for a later lane)and a date subfield compared with a date field stops at call / classification (
if-d0,if-d3).Gates
4e1d4d762f92c1ca45a3