From 06ce6d8b66db0a274e36d05f8a9b470455b84728 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Mon, 7 Sep 2026 23:04:15 -0700 Subject: add tracing of the latest output point in packstring this is necessary because packstring isn't implemented in terms of pack8, unlike packalign also add a bunch more magic comments to hex.e, which would be in the wrong place without the semantic change Force-Push: yes Change-Id: I422b8d00a07568be5113e005fddaeab82f5ca731 --- transform.e | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'transform.e') diff --git a/transform.e b/transform.e index 3086968..ce51255 100644 --- a/transform.e +++ b/transform.e @@ -2988,7 +2988,7 @@ allocate-transformation-state s" transformation-state" variable dup hex-output-metadata-entry-type @ hex-output-metadata-entry-type-string-literal = { - newline + fresh-line ." ~ Null-terminated string literal: " 0x22 value@ emitstring drop dup hex-output-metadata-entry-string @ emitstring @@ -2999,7 +2999,7 @@ allocate-transformation-state s" transformation-state" variable dup hex-output-metadata-entry-type @ hex-output-metadata-entry-type-alignment = { - newline + fresh-line ." ~ Alignment padding to width " dup hex-output-metadata-entry-string @ . newline @@ -3215,6 +3215,24 @@ allocate-transformation-state s" transformation-state" variable s" dup" find entry-to-execution-token , s" stringlen" find entry-to-execution-token , s" 1+" find entry-to-execution-token , + ~ (output point, string pointer, string length including terminator) + + ~ Before we add the metadata entry, we also want to call hex-pack-trace + ~ to make sure latest-output-point gets adjusted for the string. + ~ Otherwise, we'd see magic comments in the wrong place. + s" 3roll" find entry-to-execution-token , + s" dup" find entry-to-execution-token , + s" lit" find entry-to-execution-token , + 4 , + s" unroll" find entry-to-execution-token , + s" swap" find entry-to-execution-token , + s" dup" find entry-to-execution-token , + s" 3unroll" find entry-to-execution-token , + ~ (output point, string pointer, string length including terminator, + ~ output point, string length including terminator) + ' hex-pack-trace entry-to-execution-token , + + ~ (output point, string pointer, string length including terminator) s" swap" find entry-to-execution-token , ' hex-output-metadata-entry-type-string-literal entry-to-execution-token , s" swap" find entry-to-execution-token , @@ -3355,6 +3373,9 @@ allocate-transformation-state s" transformation-state" variable s" -" find entry-to-execution-token , ~ (output point, alignment byte width, padding start, padding length) + ~ This would be the place to put a call to hex-pack-trace, but packalign + ~ is implemented using pack8, so it's not necessary. + ' hex-output-metadata-entry-type-alignment entry-to-execution-token , ~ (output point, alignment byte width, padding start, padding length,, ~ entry type) -- cgit 1.4.1