includes/type: Fix parsing of signed leb128 (#333)

This commit is contained in:
Andrey Andreyevich Bienkowski
2024-12-18 23:49:16 +03:00
committed by GitHub
parent 2db9993cb1
commit 883433b260

View File

@@ -43,7 +43,7 @@ namespace auto type {
fn transform_sleb128_array(ref auto array) {
s128 res = type::impl::transform_uleb128_array(array);
if (res & 0x40 != 0) {
if (res & 1 << ((sizeof(array) / sizeof(u8)) * 7 - 1) != 0) {
res |= ~0 << (sizeof(array) / sizeof(u8)) * 7;
}
return res;