@@ -192,15 +192,15 @@ func (d *intDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) erro
192
192
}
193
193
switch d .kind {
194
194
case reflect .Int8 :
195
- if i64 <= - 1 * (1 << 7 ) || (1 << 7 ) <= i64 {
195
+ if i64 < - 1 * (1 << 7 ) || (1 << 7 ) <= i64 {
196
196
return d .typeError (bytes , s .totalOffset ())
197
197
}
198
198
case reflect .Int16 :
199
- if i64 <= - 1 * (1 << 15 ) || (1 << 15 ) <= i64 {
199
+ if i64 < - 1 * (1 << 15 ) || (1 << 15 ) <= i64 {
200
200
return d .typeError (bytes , s .totalOffset ())
201
201
}
202
202
case reflect .Int32 :
203
- if i64 <= - 1 * (1 << 31 ) || (1 << 31 ) <= i64 {
203
+ if i64 < - 1 * (1 << 31 ) || (1 << 31 ) <= i64 {
204
204
return d .typeError (bytes , s .totalOffset ())
205
205
}
206
206
}
@@ -225,15 +225,15 @@ func (d *intDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.P
225
225
}
226
226
switch d .kind {
227
227
case reflect .Int8 :
228
- if i64 <= - 1 * (1 << 7 ) || (1 << 7 ) <= i64 {
228
+ if i64 < - 1 * (1 << 7 ) || (1 << 7 ) <= i64 {
229
229
return 0 , d .typeError (bytes , cursor )
230
230
}
231
231
case reflect .Int16 :
232
- if i64 <= - 1 * (1 << 15 ) || (1 << 15 ) <= i64 {
232
+ if i64 < - 1 * (1 << 15 ) || (1 << 15 ) <= i64 {
233
233
return 0 , d .typeError (bytes , cursor )
234
234
}
235
235
case reflect .Int32 :
236
- if i64 <= - 1 * (1 << 31 ) || (1 << 31 ) <= i64 {
236
+ if i64 < - 1 * (1 << 31 ) || (1 << 31 ) <= i64 {
237
237
return 0 , d .typeError (bytes , cursor )
238
238
}
239
239
}
0 commit comments