Operation 65 is the step of an array element address (touches rpg_eval.zig) #715
Loading…
Reference in a new issue
No description provided.
Delete branch "sourcerer-op65-element"
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?
Operation 65 is the step of an array element address (touches rpg_eval.zig)
After operation 138 got its arm the failing operation of the array element
shape moved to 65. In
34 A 0; ...; 27 K; 138; 78 4; 65 W; 32 A 0 TEtheoperation takes the zero-based index and the address of the array and leaves
the address plus index * W, W the element width (9, 9 and 1 on the public
twins decimal-fault-report 45, decimal-sign-report 55 and OPS cond-not 26).
rpg_eval_ops.zighas the arm: a constant index becomes a plain offset, avariable index becomes an element address whose
- 1is dropped to give theone-based index.
rpg_eval.zighas two edits, in their own commit: the newValuevariantelement_address(with its refusal in the two exhaustiveswitches over
Value) and one case in arm 32 that reads it asNAME(index)after checking the symbol, the offset and the element width.rpg_op65_test.zigdrives the three twins through arms 65 and 32.A character part of an indexed array element reads as %SUBST of the element
65 Wis followed in two more shapes (SC-ILE/EXPERIMENTS l3b-ds-var andl3b-subst-var, captured 2026-11-04 with their constant-index controls):
27 K; 62; 32 A 0 TEfor a field of an array of data structures(
rec(i).name, K the field offset) and27 P; 75 8; 35 T1; 27 T1; 27 ONE; 52; 27 L; 75 8; 77 8; 35 T2; 62; 32 X 0 TEfor%SUBST(names(i): P: L).Both are the bytes OFF..OFF+LEN of the element; the head may be
34 A 0or33 A.rpg_array_element.zigreads them as one unit (a characterTEno wider than the rest of the element; an integer field, and every store
into an element, stay unmatched) and
rpg_eval_builtins.ziggives%SUBST(A(N): OFF + 1: LEN).Decision rule, field or substring: the operations do not tell. A field at
a constant offset and a
%SUBSTat the same bytes are the same bytes, andthe compiler folds a constant position into the same offset. The unit
therefore always gives the neutral form, which recompiles to the same
bytes, and the array is declared
char(W) dim(D)from the fact. Only thedeclaration can say that the bytes are a subfield (a data structure array
with that field at that offset), and that is the declaration stage's
decision (
rpg_source_decl_emit.zig), not the unit's. l3b-ds-var thereforereads
%SUBST(A(I): 5: 9)of achar(13) dim(5)until the declarationstage recovers the data structure.
Not in this change: the stores (
65 W; 27 c; 42 A 0 TE,65 W; 27 K; 62; ...; 42), and an integer field read (65 13; 32 A 0 TEwith a four-byteTE), which need the store path and the type of the field.The six captures are adopted as public twins (the matrix rows are classed
by the coordinator).
%SUBST of a part of a data structure passes operation 62 (touches rpg_eval.zig)
Five public statements of SC-ILE/EXPERIMENTS h-subfill stopped at
62withvalue_flow/stack_value:H = %subst(R.c : 2 : 3),%subst(R.c : 1 : 2) = 'ab',H = %subst(ub : 3 : 4),%subst(ub : 2 : 3) = CandR.a = %subst(R.c : 3). The unit ofrpg_subst_offset.zig(27 START; 75 8; 35 T; 33|34 B; 27 T; 27 1; 52; 27 LEN; 75 8; 77 8; 35 N; 62) did not readtwo forms of them:
data structure of the form
33 R; 27 K; 62):recoverStackedreads theeleven operations without the base operation;
34 B offwith a nonzero offset (ub, a subfield of adata structure without a name):
recoverPartaccepts it and checks therange from the offset.
recoveris unchanged for its other caller(
rpg_decimal_call.zig).rpg_eval.zighas the one edit: arm 62 asksrecoverPart, thenrecoverStacked, for the offset START - 1 of a text start. The fourth andfifth statements pass;
%subst(R.c : 3)(no length operand) still stops at62 and is the next shape. Twins: no regression; emit: three statements more
(h-subfill and l3b-subst-const).
Gates