rpg_programs.zig, rpg_argument_copy.zig: a character literal copied to a CONST parameter of a program call #749

Manually merged
binjovi-bot merged 5 commits from lc2i into trunk 2026-11-07 13:18:26 +00:00
Owner

rpg_programs.zig, rpg_argument_copy.zig: a character literal copied to a CONST parameter of a program call

invoke('HELLO': number) to an extpgm prototype with text char(10) const
(SC-ILE/EXPERIMENTS program-char) stopped at type_inference / operation 75, the
frame of the call. Operation 75 is not the cause: rpg_programs.call refused the
call before the frame was removed, and the fallback to the raw operations
reported the first operation it could not read. Two causes:

  • The parameter list. The parse took 35 V; 33 V; 113 q m; 4 N 1 for every
    entry. The entry of a character literal that the call copied has no retag
    (35 V; 33 V; 4 N 1): the address of the copy is passed as it is. The parse
    now walks the list from its end, takes the retag when it is there, and gives the
    entry mode 3 when it is not.
  • The copy. The compiler stores the literal in an automatic temporary of the
    parameter's width, blanks the other bytes behind it (97 0 3 10 0) and passes
    the address of the temporary. rpg_argument_copy.character proves the whole
    unit against the original operations (the temporary and the pointer are
    compiler temporaries of the procedure, the literal is shorter than the
    parameter, the two counts agree, the blank is x'40', the prototype is the
    measured program descriptor, and nothing names the temporary between the copy and
    the call). The fact is copied_character_argument_v1, text
    COPY_REF_CHAR(HEX(C8C5D3D3D6), WIDTH 10); the source emitter writes the
    literal and the char(10) const parameter of the prototype.

invoke('HELLO': number) now emits INVOKE('HELLO': INVOKE_00254); with
*n char(10) const; in the prototype.

Open: the decimal conversions of a program call (not done)

Three public twins stop in the same place, at the copy of a decimal argument, and
are not read:

  • program-decimal-widen: packed(15:0) to packed(16:0) (61 16 0 0);
  • program-convert: packed(11:3) to packed(9:2) (61 9 -1 0, one digit dropped);
  • program-packed-field-0: int(10) to packed(9:0) (75 8; 86 20; 61 9 0 0).

rpg_decimal_copy.inspect reads exactly one conversion, packed 16 digits to 15 at
shift 0, and its fact (COPY_REF_PACKED_CHECKED) states what the host measured for
it: MCH1202 on invalid data, MCH1210 on overflow, the receiver unchanged and no call.
Nothing measures those rules for the three conversions above; a shift of -1 loses a
digit. They stay open until a run states the exceptions and the truncation; a rule
without it would be a guess that no gate catches.

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"current","emit":{"worse":[],"better":4,"newly_clean":4,"clean_delta":4,"base":415,"new":419},"twins":{"groups":651,"recovered":642,"regressions":[],"newly":29},"allgroups":{"regressions":[],"newly":["savf/SC-CONSTRUCT/TLICR/archive.savf 2","savf/SC-CONSTRUCT/TRPG3/archive.savf 1","savf/SC-ILE/EXPERIMENTS/h-bifs-char/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/program-char/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r9r-decstr/stripped/object.savf 1"],"worse":["savf/SC-CONSTRUCT/TLICR/archive.savf|TLICR.PGM|3031-3121","savf/SC-CONSTRUCT/TRPG3/archive.savf|TRPG3.PGM|3179-3362"]},"full_check":{"exit":0,"seconds":875}}
## rpg_programs.zig, rpg_argument_copy.zig: a character literal copied to a CONST parameter of a program call `invoke('HELLO': number)` to an `extpgm` prototype with `text char(10) const` (SC-ILE/EXPERIMENTS program-char) stopped at type_inference / operation 75, the frame of the call. Operation 75 is not the cause: `rpg_programs.call` refused the call before the frame was removed, and the fallback to the raw operations reported the first operation it could not read. Two causes: - **The parameter list.** The parse took `35 V; 33 V; 113 q m; 4 N 1` for every entry. The entry of a character literal that the call copied has no retag (`35 V; 33 V; 4 N 1`): the address of the copy is passed as it is. The parse now walks the list from its end, takes the retag when it is there, and gives the entry mode 3 when it is not. - **The copy.** The compiler stores the literal in an automatic temporary of the parameter's width, blanks the other bytes behind it (`97 0 3 10 0`) and passes the address of the temporary. `rpg_argument_copy.character` proves the whole unit against the original operations (the temporary and the pointer are compiler temporaries of the procedure, the literal is shorter than the parameter, the two counts agree, the blank is x'40', the prototype is the measured program descriptor, and nothing names the temporary between the copy and the call). The fact is `copied_character_argument_v1`, text `COPY_REF_CHAR(HEX(C8C5D3D3D6), WIDTH 10)`; the source emitter writes the literal and the `char(10) const` parameter of the prototype. `invoke('HELLO': number)` now emits `INVOKE('HELLO': INVOKE_00254);` with `*n char(10) const;` in the prototype. ## Open: the decimal conversions of a program call (not done) Three public twins stop in the same place, at the copy of a decimal argument, and are not read: - program-decimal-widen: packed(15:0) to packed(16:0) (`61 16 0 0`); - program-convert: packed(11:3) to packed(9:2) (`61 9 -1 0`, one digit dropped); - program-packed-field-0: int(10) to packed(9:0) (`75 8; 86 20; 61 9 0 0`). `rpg_decimal_copy.inspect` reads exactly one conversion, packed 16 digits to 15 at shift 0, and its fact (`COPY_REF_PACKED_CHECKED`) states what the host measured for it: MCH1202 on invalid data, MCH1210 on overflow, the receiver unchanged and no call. Nothing measures those rules for the three conversions above; a shift of -1 loses a digit. They stay open until a run states the exceptions and the truncation; a rule without it would be a guess that no gate catches. ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"current","emit":{"worse":[],"better":4,"newly_clean":4,"clean_delta":4,"base":415,"new":419},"twins":{"groups":651,"recovered":642,"regressions":[],"newly":29},"allgroups":{"regressions":[],"newly":["savf/SC-CONSTRUCT/TLICR/archive.savf 2","savf/SC-CONSTRUCT/TRPG3/archive.savf 1","savf/SC-ILE/EXPERIMENTS/h-bifs-char/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/program-char/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r9r-decstr/stripped/object.savf 1"],"worse":["savf/SC-CONSTRUCT/TLICR/archive.savf|TLICR.PGM|3031-3121","savf/SC-CONSTRUCT/TRPG3/archive.savf|TRPG3.PGM|3179-3362"]},"full_check":{"exit":0,"seconds":875}} ```
binjovi-bot manually merged commit 36f1f1e9ff into trunk 2026-11-07 13:18:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!749
No description provided.