tape: Fix crash when decoding a bool sometimes

This commit is contained in:
2025-10-15 01:16:03 -04:00
parent 8446ae6186
commit 0ac26711ac
2 changed files with 21 additions and 5 deletions

View File

@@ -440,6 +440,8 @@ func setInt(destination reflect.Value, value int64, bytes int) {
// setUint expects a settable destination.
func setUint(destination reflect.Value, value uint64, bytes int) {
switch {
case destination.Kind() == reflect.Bool:
destination.Set(reflect.ValueOf(value > 0))
case destination.CanInt():
destination.Set(reflect.ValueOf(int64(value)).Convert(destination.Type()))
case destination.CanUint():