From 5f4a6d4941de23180e7c412cc9ddf5ce440e3829 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 27 Jun 2026 09:06:36 -0700 Subject: [PATCH] libbacktrace: set table field for zstd RLE sequence Patch from Ivan Molodetskikh. * elf.c (elf_zstd_unpack_seq_decode): Set table field for RLE sequence. * zstdtest.c (tests): Add rle-sequence-tables test. --- elf.c | 1 + zstdtest.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/elf.c b/elf.c index 0de12bc..e1c3458 100644 --- a/elf.c +++ b/elf.c @@ -4302,6 +4302,7 @@ elf_zstd_unpack_seq_decode (int mode, decode->table_bits = 0; if (!conv (&entry, 0, table)) return 0; + decode->table = table; } break; diff --git a/zstdtest.c b/zstdtest.c index db80726..202b5b9 100644 --- a/zstdtest.c +++ b/zstdtest.c @@ -208,6 +208,24 @@ static const struct zstd_test tests[] = "\x4c\x1f\xf9\xf1"), 30, }, + { + "rle-sequence-tables", + "AAAA", + 0, + ("\x28\xb5\x2f\xfd" + "\x20" /* Single_Segment_flag; Frame_Content_Size_flag = 0 */ + "\x04" /* Frame_Content_Size */ + "\x45\x00\x00" /* Last_Block, Compressed_Block, size 8 */ + "\x08" /* Raw_Literals_Block, Regenerated_Size 1 */ + "A" + "\x01" /* Number_of_Sequences */ + "\x54" /* RLE literals length, offset, and match length tables */ + "\x01" /* literal length code: 1 */ + "\x00" /* offset code: repeat offset 1 */ + "\x00" /* match length code: 3 */ + "\x80"), /* bitstream end marker */ + 17, + }, }; /* Test the hand coded samples. */