tape: Fix crash when decoding a bool sometimes
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user