rpg_decimal_convert.zig, rpg_programs.zig, rpg_source_calls_emit.zig: a computed value copied to a CONST packed parameter of a program call #753
Loading…
Reference in a new issue
No description provided.
Delete branch "lc2l"
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_decimal_convert.zig, rpg_programs.zig, rpg_source_calls_emit.zig: a computed value copied to a CONST packed parameter of a program call
Four captures (lc2-arg-expr-add
p92 + p72, lc2-arg-expr-muli10 * 2, lc2-arg-uns5 andlc2-arg-uns10
u5, each topacked(9:2) const) stopped at type_inference / operation 75 in theargument setup. The copy of the argument is not one field read and converted
(
29 F 0 T; 61 ...,rpg_decimal_convert.inspectLength) but a value that loads, conversions andarithmetic build:
rpg_decimal_convert.computedfinds the value backward from the shift: its operations leave onevalue on the stack, are at most 24, and are loads (27, 29), conversions (75, 76, 84, 86, 87, 88) or
arithmetic (47, 51, 52, 54). The storage, ownership and original-operation proof is that of the other
readers. The operations stay in the body: the evaluator builds the text of the value.
copied_decimal_argument_v1withcomputed, textCOPY_REF_VALUE(TO A291 packed(9), SHIFT 2).The argument shows as
COPY_REF_VALUE(S270 + S269, TO packed(9), SHIFT 0): the text of thevalue the evaluator built, the digits and the shift. No exception or truncation is stated.
packed(M:s) constparameter whose positions arethose of the value (integers none, a sum the larger, a product the sum; a field of unproved positions
leaves them unproved) plus the shift. The arguments of a call are split at
:outside parentheses.Statement 39 of the four captures is recovered;
invoke(i10 * 2: text)emitsINVOKE(INVOKE_00262 * 2: ...)with*n packed(9:2) const,u5emits*n packed(9:2) const. The sum has unproved positions (placeholders, 0 assumed).The
*inlr = *onof these programs (statement 40) stops at remaining effects of the procedure: thestatic initialization of the data structure and the array that the battery declares; not read here.
A value of a literal and one conversion (
27 K; 86 D; 61 ...) is not read as a computed value: thepacked literal readers own that form and refuse its malformed operands, and
rpg_packed_copy_testpins those refusals.
ROUND9 summary of lane Lc2
Shipped as public gains, stacked in order: lc2j (PR 750, decimal conversions of a program-call
argument), lc2k (PR 752, a character field copied to a larger CONST character parameter) and this
change (a computed value copied to a CONST packed parameter).
Rules in the lane, by construct: the
%INT(%TRIM)condition; element index, part and store, andsubfield arrays;
%DEC,%INTand%SCANof an element; trim and concatenation of elements; callswith a CONST buffer and shared imports; varying concatenation; character literal and field CONST
arguments; decimal conversions and negative literals; computed values to a packed CONST parameter.
Held-out result: unchanged. A source was read by mistake and reported; nothing from it was used.
Open, not done:
%SCAN(%TRIM)(dict sv4..14), dict-calls2 statements 72 and 76, a varying target ofa concatenation, a post-call varying block (return-concat), the static initialization at
*inlr = *onof the program-args captures, the float conversion (op 97) of a program-call argument,
%CHECK,%REPLACE,%SCANRPL,%UPPER,%LOOKUP,%SQRTanddsply. Decimal positions that the objectdoes not prove stay unproved.
Gates