A numeric array held in a data structure is declared as an array #737
Loading…
Reference in a new issue
No description provided.
Delete branch "lr1-big-ds"
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?
A numeric array held in a data structure is declared as an array
A 6000-byte numeric array that the source declares in a data structure
(
dcl-ds a dim(1000) qualified; v packed(11:2); end-ds;, or an arraysubfield) starts blank in the object (
FILL[6000] = X'40'), not zero. Thedeclaration rule of lr1-num-elem refused that initial value, so the array
stayed undeclared and every element statement failed (twins lr1-bs-ds-dim and
lr1-bs-ds-overlay).
arrayDefaultinrpg_source_decl_emit.zignow acceptsthe blank fill, and the array is declared
packed(11:s) dim(n)and theelement arithmetic recovers.
Known gap: the emitted array is a standalone array, so the rebuilt object
starts zero, not blank; the decimal positions of the array are not proved
(
packed(11:0)).An element at an index that the statement computes before the unit
(
a(i + 1)) was not a unit: the compiler loads and adds the index, then34 A 0; 5; 35 Ttakes it from the stack instead of loading the field. Thearray fact never formed, so the array stayed undeclared.
prefixOfinrpg_array_element.zigreads that head, and the element takes its index textfrom the stack (twin lr1-ec-loop-next). An array that is only indexed at
constants (
b(1)) has no variable-index unit and stays undeclared.An element at a decimal index (
ipacked(5:0), zoned(4:0) or packed(3:0)) isanother head: the compiler loads the field, converts it to binary and
subtracts one, with no bounds labels and no temporary, then checks the index
against the dimension (
34 A 0; 29 P; [84;] 87; 75; 77; 27 1; 52; 27 K; 138; 78 4; 65 W).decimalPrefixinrpg_array_element.zigreads it with thedecimal field as the index (twins lr1-di-*). A
forover a decimal index isstill unresolved (its control statements are not emitted).
Gates