From 7c3efe3b92816697383c5792d7876e7ed6e331ae Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 10 May 2025 21:13:09 +0200 Subject: Update GDB pretty printer following SSO layout change Commit 2754e27cf (Increase SSO from 22 to 23 chars., 2024-06-07) changed they layout of SSO-strings. Specifically, is_long() no longer takes a bit away from the size field. Update the GDB pretty printer accordingly, making it work with small strings again. --- src/string.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.hh') diff --git a/src/string.hh b/src/string.hh index 677f01f5..fd1e5b74 100644 --- a/src/string.hh +++ b/src/string.hh @@ -184,7 +184,7 @@ public: Data& operator=(const Data& other); Data& operator=(Data&& other) noexcept; - bool is_long() const { return (u.l.mode& Long::active_mask) > 0; } + bool is_long() const { return (u.l.mode & Long::active_mask) != 0; } size_t size() const { return is_long() ? u.l.size : (Short::capacity - u.s.remaining_size); } size_t capacity() const { return is_long() ? u.l.capacity : Short::capacity; } -- cgit v1.2.3