From daaf9878a90762b337429168a9f5959129a7a405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20T=C3=B4rres?= Date: Wed, 4 Dec 2024 22:00:06 -0800 Subject: [PATCH] fix: ReadSleb128 (#69) --- pkg/trie/trie.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/trie/trie.go b/pkg/trie/trie.go index 3313a2e..ca80248 100644 --- a/pkg/trie/trie.go +++ b/pkg/trie/trie.go @@ -85,11 +85,11 @@ func ReadSleb128(r *bytes.Reader) (int64, error) { // If high order bit is 1. if (b & 0x80) == 0 { - break - } + if (shift < 64) && ((b & 0x40) > 0) { + result |= -(1 << shift) + } - if (shift < 64) && ((b & 0x40) > 0) { - result |= -(1 << shift) + break } }