rpg_eval.zig: the concatenation of varying-length fields, pieces at computed offsets #747
Loading…
Reference in a new issue
No description provided.
Delete branch "lc2h"
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_eval.zig: the concatenation of varying-length fields, pieces at computed offsets
A concatenation with a varying-length piece stopped at value_flow / operation 62
(lc2-cat-varchar-src, -two, -both, -field, lc2-cat-call-const-vary2). The compiler
copies the data of the first field to a buffer and addresses the next piece at the
buffer plus the length of the first (
27 L; 62). That length is a temporary thatthe program computed, so the evaluator, which knew only numeric offsets of an
address, had nothing to add to.
Value.address_plusis the addressof a temporary at a byte plus a length that is the text of a value. It is a
variant of its own, never an
address, so no rule that tests a numeric offsetcan match it, and
Address, the key of the saved temporaries, does not change.62produces it only for a temporary base whose offset is neither an integernor a recognised substring start.
address_plus, is a piece: it follows the piece that has the length in theaddress, and its text is the field (a varying field is read as its data and
its length, proved by the load of its first two bytes), a literal or a field.
The copy of the whole buffer reads the pieces, in order, as
a + b.(error 115 when the length is more than the size less the two length bytes),
the minimum of the total and the size of a varying target
(
27 A; 27 B; 11; 17 L; 27 B; 35 A; 15 L 1), and the blank fill after the copyto a fixed field (the fill is the pad of the copy, which becomes the assignment).
A skip whose label lies after the body of the statement (the fill) is closed
at the end of the run when it is proved.
Results:
S262.0 = S268 + 'x',S262.0 = S268 + S269,S267 = S268 + S269,S267 = S268 + S255andCALLP SHOWV(S268 + S269). Still open in the battery:lc2-cat-varchar-tgt (
v = a + b) and lc2-cat-call-const-vary (showv(a + 'x')),which stop at call / 97 on a first copy of another shape, and lc2-cat-return-concat.
Gates