Browse Source

fixed overflow error on some systems

Christoph Hack 12 năm trước cách đây
mục cha
commit
70172e5ef2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      marshal.go

+ 1 - 1
marshal.go

@@ -336,7 +336,7 @@ func marshalBigInt(info *TypeInfo, value interface{}) ([]byte, error) {
 	case int:
 		return encBigInt(int64(v)), nil
 	case uint:
-		if v > math.MaxInt64 {
+		if uint64(v) > math.MaxInt64 {
 			return nil, marshalErrorf("marshal bigint: value %d out of range", v)
 		}
 		return encBigInt(int64(v)), nil