[Git][ghc/ghc][wip/T26312] rts/IPE: Fix compilation when zstd is enabled

Ben Gamari pushed to branch wip/T26312 at Glasgow Haskell Compiler / GHC Commits: 391cd5bf by Ben Gamari at 2025-09-02T18:06:07-04:00 rts/IPE: Fix compilation when zstd is enabled This was broken by the refactoring undertaken in c80dd91c0bf6ac034f0c592f16c548b9408a8481. Closes #26312. - - - - - 1 changed file: - rts/IPE.c Changes: ===================================== rts/IPE.c ===================================== @@ -313,38 +313,41 @@ void decompressIPEBufferListNodeIfCompressed(IpeBufferListNode *node) { barf("An IPE buffer list node has been compressed, but the " "decompression library (zstd) is not available."); #else + // Decompress string table size_t compressed_sz = ZSTD_findFrameCompressedSize( - node->string_table, + node->string_table_block->string_table, node->string_table_size ); - char *decompressed_strings = stgMallocBytes( - node->string_table_size, + IpeStringTableBlock *decompressed_strings = stgMallocBytes( + sizeof(IpeStringTableBlock) + node->string_table_size, "updateIpeMap: decompressed_strings" ); + decompressed_strings->magic = IPE_MAGIC_WORD; ZSTD_decompress( - decompressed_strings, + decompressed_strings->string_table, node->string_table_size, - node->string_table, + node->string_table_block->string_table, compressed_sz ); - node->string_table = (const char *) decompressed_strings; + node->string_table_block = decompressed_strings; // Decompress the IPE data compressed_sz = ZSTD_findFrameCompressedSize( - node->entries, + node->entries_block->entries, node->entries_size ); - void *decompressed_entries = stgMallocBytes( - node->entries_size, + IpeBufferEntryBlock *decompressed_entries = stgMallocBytes( + sizeof(IpeBufferEntryBlock) + node->entries_size, "updateIpeMap: decompressed_entries" ); + decompressed_entries->magic = IPE_MAGIC_WORD; ZSTD_decompress( - decompressed_entries, + decompressed_entries->entries, node->entries_size, - node->entries, + node->entries_block->entries, compressed_sz ); - node->entries = decompressed_entries; + node->entries_block = decompressed_entries; #endif // HAVE_LIBZSTD == 0 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/391cd5bf3073d731158a7afa40251472... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/391cd5bf3073d731158a7afa40251472... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Ben Gamari (@bgamari)