rpg_decimal_call.zig, rpg_subst_offset.zig, rpg_trim.zig, rpg_eval.zig, rpg_eval_builtins.zig and rpg_facts.zig: %DEC of a %SUBST with a variable start #766
Loading…
Reference in a new issue
No description provided.
Delete branch "lo15c"
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_call.zig, rpg_subst_offset.zig, rpg_trim.zig, rpg_eval.zig, rpg_eval_builtins.zig and rpg_facts.zig: %DEC of a %SUBST with a variable start
part = %dec(%subst(out7 : pos : 3) : 3 : 0)(SC-ILE/EXPERIMENTSr5e-editc-held, G6 of the dump, source statement 12) stopped at control_flow /
operation_semantics on operation 15: the range checks of the substring keep four
labels, and
rpg_subst_offsetreads a literal start only.rpg_subst_offset.recoverVariablereads the 44 operations of the unit: thecheck of the start (1 .. LEN, error 100),
start - 1 + COUNT, the check ofthe end (0 .. LEN) and the address operation 62, for a character field F, a
constant COUNT with 0 < COUNT <= LEN and temporaries of the procedure.
rpg_trim.substCountrewrites the unit, the113and the load of the lengthto
op_subst_var(operands F and COUNT; the start stays on the stack, thevalue is
%SUBST(F: start: COUNT)), the113and the load of COUNT.rpg_decimal_call.recoverFromtakes this unit as the source of the_QRNX_GET_DECIMAL_NUMcall (variableSource): the length argument is thetemporary that the unit wrote, the four labels have no other jump and no label
pointer, the fact range starts at the unit. The fact has
variable_start; itstext writes
ADDRESS(A254.START, 3)and not a byte offset that is not known.isTextSourcereplaces the two tests of%TRIM(inbuiltinCall(the sourceis the text of a unit).
Result:
S255 = %DEC(%SUBST(S254: S256: 3): 3: 0), emitted asA_00255 = %DEC(%SUBST(A_00254: A_00256: 3): 3: 0);. The red test isr5e-editc-held G6 / 12 in
src/rpg_lo15_labels_test.zig.%LEN of a varying-length field is shown as the length
Since v0.1.466 h-bifs-char statement 37,
I = %len(V)withV varchar(20), wasshown as
S259 = S267and emitted asA_00259 = V00267;: the load of the twolength bytes pushed the name of the field, and the program is then not the
source (the h-bifs-char twin did not compile, RNF7416). The length check that
follows the load (error 115 above the size less two) is the proof that the two
bytes are the length of a varying-length field.
rpg_eval.varyingChecknowrewrites the value of the load on the stack, in the saved copies and in the record
of the length to
%LEN(F)once it has proved the check(
varyingLengthShown). Without the check the text stays as before. Thered test is h-bifs-char G22 / 37 (
src/rpg_lo15_labels_test.zig).