rpg_decimal_convert.zig, rpg_programs.zig, rpg_eval.zig, rpg_source_calls_emit.zig: a decimal argument converted for a CONST packed parameter of a program call #750
Loading…
Reference in a new issue
No description provided.
Delete branch "lc2j"
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_eval.zig, rpg_source_calls_emit.zig: a decimal argument converted for a CONST packed parameter of a program call
Four public twins stopped at type_inference / operation 75 in the argument setup
of a call to an external program: program-decimal-widen (packed(15:0) to
packed(16:0) const), program-convert (packed(11:3) topacked(9:2) const),program-packed-field-0 (int(10) to
packed(9:0) const) and program-packed-field-2(int(10) to
packed(9:2) const). The call was refused before the frame wasremoved;
rpg_decimal_copyreads one conversion only, 16 digits to 15 at shift 0.The unit.
rpg_decimal_convert.inspectreads, for any packed field ofFROM digits or a 4-byte integer,
29 F 0 TY; [75 8; 86 20;] 61 TO SHIFT 0; 37 T 0 TP; 33 T; 113 q 1, with the storage, ownership and original-operationproof of
rpg_argument_copy.storage. The new factcopied_decimal_argument_v1,text
COPY_REF_DEC(FROM S253 packed(11), TO A291 packed(9), SHIFT -1), states theshape and the declared types and nothing else: what the conversion does with an
invalid value, an overflow or a dropped digit is not measured and is not claimed.
The fact of the 16-to-15 conversion keeps its text.
The source. The shape
61 TO SHIFT 0compiles fromP constwith an argumentwhose type has the positions of the parameter less SHIFT. The emitter writes the
argument and a
packed(TO:s) constparameter with s the positions of the fieldplus SHIFT. When no positions are proved and SHIFT drops some (program-convert,
packed(11:3) to packed(9:2)), the emitter reports the call as a failure
(
the decimal positions of the argument are not proved) and chooses none: a guessednumber (
packed(11:1) inz(1250.0)) has the same init bytes but compiles to anotherliteral pool and does not match.
The evaluator writes the width of the fact's target, not a fixed 8 bytes.
A negative literal (
invoke(-42: text), program-packed-held-negative):27 K; 86 D; 61 TO SHIFT 0; 37 T 0 TP; 33 T; 113 q 1with K an integer constant belowzero.
rpg_argument_copy.packedNegativereads it aspackedLiteralreads a positiveone, with the sign nibble D:
COPY_REF_PACKED_BYTES(HEX(000004200d), DIGITS 9),emitted as
INVOKE(-42: ...)withpacked(9:2) const.Emits: program-decimal-widen, program-packed-field-0, program-packed-field-2 and program-packed-held-negative are clean (the first three round-trip to MATCH). program-convert is recovered (
COPY_REF_DEC) and its emit fails on the positions.Gates