上传redis 解码异常问题

This commit is contained in:
liwei1dao 2022-11-15 11:30:40 +08:00
parent e39d409090
commit a565e80824
3 changed files with 8 additions and 3 deletions

View File

@ -279,7 +279,7 @@ func (this *mapDecoder) Decode(ptr unsafe.Pointer, extra codecore.IReader) {
return
}
if extra.CheckNextIsObjectEnd() {
extra.ReadObjectEnd()
// extra.ReadObjectEnd()
return
}
key := this.keyType.UnsafeNew()

View File

@ -307,6 +307,11 @@ func (this *structDecoder) Decode(ptr unsafe.Pointer, r codecore.IReader) {
if !r.ReadObjectStart() {
return
}
if r.CheckNextIsObjectEnd() { //空对象直接跳出
return
}
this.decodeField(ptr, r)
for r.ReadMemberSplit() {
this.decodeField(ptr, r)

View File

@ -141,10 +141,10 @@ func (this *JsonReader) ReadObjectStart() (ret bool) {
}
func (this *JsonReader) CheckNextIsObjectEnd() (ret bool) {
c := this.nextToken()
this.unreadByte()
if c == '}' {
return true
return this.decrementDepth()
}
this.unreadByte()
return
}
func (this *JsonReader) ReadObjectEnd() (ret bool) {