[Git][ghc/ghc][wip/gc/refactor-mark-thread] 2 commits: testsuite/cloneStackLib: Fix incorrect format specifiers

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Sun Aug 6 12:18:26 UTC 2023



Ben Gamari pushed to branch wip/gc/refactor-mark-thread at Glasgow Haskell Compiler / GHC


Commits:
5f38bedc by Ben Gamari at 2023-08-06T08:12:58-04:00
testsuite/cloneStackLib: Fix incorrect format specifiers

- - - - -
94d0c303 by Ben Gamari at 2023-08-06T08:14:17-04:00
rts/ipe: Fix const-correctness of IpeBufferListNode

Both info tables and the string table should be `const`

- - - - -


2 changed files:

- rts/include/rts/IPE.h
- testsuite/tests/rts/cloneStackLib.c


Changes:

=====================================
rts/include/rts/IPE.h
=====================================
@@ -76,12 +76,12 @@ typedef struct IpeBufferListNode_ {
 
     // When TNTC is enabled, these will point to the entry code
     // not the info table itself.
-    StgInfoTable **tables;
+    const StgInfoTable **tables;
 
     IpeBufferEntry *entries;
     StgWord entries_size; // decompressed size
 
-    char *string_table;
+    const char *string_table;
     StgWord string_table_size; // decompressed size
 } IpeBufferListNode;
 


=====================================
testsuite/tests/rts/cloneStackLib.c
=====================================
@@ -27,14 +27,14 @@ void expectStacksToBeEqual(StgStack *clonedStack, StgTSO *tso) {
 
     for(StgWord i = liveStack->stack_size - 1; (liveStack->stack + i) >= liveStack->sp; i--){
         if(liveStack->stack[i] != clonedStack->stack[i]){
-            barf("Expected stack word %lu to be equal on both stacks.", i);
+            barf("Expected stack word %" FMT_Word " to be equal on both stacks.", i);
         }
     }
 }
 
 void expectStackToBeNotDirty(StgStack *stack) {
     if(stack->dirty != 0) {
-        barf("Expected stack to be not dirty. But dirty flag was set to %u", stack->dirty);
+        barf("Expected stack to be not dirty. But dirty flag was set to %" FMT_Word, (StgWord) stack->dirty);
     }
 }
 
@@ -50,7 +50,8 @@ void expectClosureTypes(StgStack *stack, unsigned int types[], size_t typesSize)
         }
 
         if(info->type != types[i]) {
-            barf("Wrong closure type on stack! Expected %u but got %u in position %lu", types[i], info->type, i);
+            barf("Wrong closure type on stack! Expected %" FMT_Word " but got %" FMT_Word " in position %" FMT_Word,
+                 (StgWord) types[i], (StgWord) info->type, i);
         }
     }
 }



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c62a8665b9711c16aa9e4f012c9537ae1819a6cb...94d0c303ddc8af29ed6c515745d51e0b5419d05b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c62a8665b9711c16aa9e4f012c9537ae1819a6cb...94d0c303ddc8af29ed6c515745d51e0b5419d05b
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230806/0893c6e4/attachment-0001.html>


More information about the ghc-commits mailing list