END-PROC claims the default initializers of local pointers and signed 1-, 2- and 8-byte integers, and %LEN(%TRIMR(F)), %LEN(%TRIML(F)) are a trim unit #801
Loading…
Reference in a new issue
No description provided.
Delete branch "lend"
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?
END-PROC claims the default initializers of local pointers and signed 1-, 2- and 8-byte integers, and
%LEN(%TRIMR(F)),%LEN(%TRIML(F))are a trim unitBattery
lend/endproc-trimr(24 public cases, captured 2026-11-14), written todecide whether the unclaimed store
27 K; 37 S 0 Nof the END-PROC of sevenpublic programs came from the EXTPGM prototype of a
main(m)procedure or from anamed activation group. It came from neither.
The END-PROC (
rpg_end.zig,rpg_initialization.zig).The last statement of a subprocedure holds the out-of-line initialization
segment of its automatic variables.
Nof37 S 0 Nis a type index, not abyte count. The stores that
Scan.atleft unclaimed were the defaults ofstandalone locals:
dcl-s p pointer;is27 K; 37 S 0 T: K the null literal, S a 16-bytepointer of the procedure, T the 16-byte pointer type (ossile 5 and 6, the
implicit
ptrof the ACCESS twin, two pointers of AOC). Newinitializers.localPointerNull, rulelocal_pointer_store_v1, in the segment.An explicit
inz(*null)is the memset form thatnullFillclaimed already(lend-c07).
int(3),int(5)andint(20)are the same pair with a signed type of 1, 2and 8 bytes (bluemoon 1
i int(5), AOCanswer int(20)). Newinitializers.localSignedStore(the 4-bytestorekeeps its callers, thestatic initialization and the closing, unchanged), rule
integer_store_v1,automatic variables in the segment only.
lend-c01 to c05 and c08 carry the same store with and without the prototype
(
main(m)against none), withreturn;, with a named,*newand*calleractivation group; lend-c06 (prototype, no local) recovered before the change.
Prototype, return and activation group change nothing.
Not claimed. The default of a local
varchar(n)is a zero fill of n + 2 bytes(
33 F; 113 T 2; 27 0; 76 4; 78 4; 27 L; 97 0 3 10 0; 3, lend-c13). It staysopen on purpose: the declaration emitter types a local varchar only when a
varying assignment proves it (the AOC programs:
varchar(100)), and declareslend-c13 (
a = 'x') aschar(102). Claiming the fill without that proof wouldturn a refusal into wrong text with no failure line. The three varchar locals of
each AOC program keep their END-PROC open for this reason. The next change is a
fill fact that the declaration emitter reads as a varchar.
The trim (
rpg_trim.zig,rpg_eval.zig,rpg_source.zig).unit(%LEN(%TRIM(F))) took only the two-loop form. It now takes the one-loopforms that
halvesalready reads:%LEN(%TRIMR(F))(34 operations from35 P,lend-a01, a04) and
%LEN(%TRIML(F))(23 operations, lend-a03). The two sizeguards (
trailing: 42,leading: 30) were larger than the units and refused theunit when the statement ended soon after it. New synthetic operations
op_triml_lengthandop_trimr_lengthcarry the kind to the statement reader.The emitter now accepts
%TRIMRand%TRIMLas built-in names (lend-a08s = %trimr(c)into a char field recovers, the unit was proved before).Not done.
v += %trimr(c),v = %trimr(c)andv += %trim(c)into a varchar(lend-a05, a06, a07, a09) stay open: the control
%trimfails the same way, so thegap is the varchar append consumer and not the trailing unit.
Probes adopted: lend-c01, c02, c03, c04, c06, c07, c08, c10, c11, c12, c13, c14,
c15, lend-a01, a02, a03, a04, a08 (SC-ILE/EXPERIMENTS). The test file is
src/rpg_lend_test.zig.rpg_end_source_test.zigno longer lists the ACCESS twinstatement 2500 as open: its one open operation was the implicit local pointer.
Gate (host round trips, base ~/bin/sourcerer v0.1.517)
f71c198d6d2f8c685162