]> Repositorios git - scryer-prolog.git/commitdiff
correct heap_print.rs for null characters being excluded from pstr regions of heap...
authorMark Thom <[email protected]>
Mon, 21 Apr 2025 00:14:13 +0000 (17:14 -0700)
committerMark Thom <[email protected]>
Wed, 23 Apr 2025 06:33:11 +0000 (23:33 -0700)
src/heap_print.rs

index c2b606576f014188a1c0d5e7a145629a170e87a1..7bd227e2b4508cd6c0b5c5aeec113ec691e73d4d 100644 (file)
@@ -1252,7 +1252,6 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
             HeapCellValueTag::PStrLoc => {
                 self.iter.pop_stack();
             }
-            // HeapCellValueTag::CStr => {}
             _ => {
                 unreachable!();
             }
@@ -1572,10 +1571,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
 
         let c = self.iter.heap.char_at(pstr_loc);
 
-        if c != '\u{0}' || pstr_loc % std::mem::size_of::<HeapCellValue>() == 0 {
-            // if a null character in a pstr has location aligned
-            // to a cell boundary, the string is ['\\x0\\'].
-
+        if c != '\u{0}' {
             if !self.max_depth_exhausted(max_depth) {
                 self.state_stack
                     .push(TokenOrRedirect::CommaSeparatedCharList(
@@ -1724,7 +1720,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
             (HeapCellValueTag::F64, f) => {
                 self.print_number(max_depth, NumberFocus::Unfocused(Number::Float(*f)), &op);
             }
-            (HeapCellValueTag::PStrLoc) => { // HeapCellValueTag::CStr | HeapCellValueTag::PStr | HeapCellValueTag::PStrOffset) => {
+            (HeapCellValueTag::PStrLoc) => {
                 self.print_list_like(max_depth);
             }
             (HeapCellValueTag::Lis) => {