Browse Source

fixed overflow error on some systems

Christoph Hack 12 years ago
parent
commit
70172e5ef2
1 changed files with 1 additions and 1 deletions
  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