about summary refs log tree commit diff
path: root/transform.e
diff options
context:
space:
mode:
Diffstat (limited to 'transform.e')
-rw-r--r--transform.e25
1 files changed, 23 insertions, 2 deletions
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)