소스 검색

fixed overflow error on some systems

Christoph Hack 12 년 전
부모
커밋
70172e5ef2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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