Skip to content

Commit 30546c3

Browse files
committed
Fix UnmarshalMsgWithState bug
1 parent a679500 commit 30546c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gen/unmarshal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ func (u *unmarshalGen) Execute(p Elem) ([]string, error) {
8181
methodRecv := methodReceiver(p)
8282

8383
u.p.printf("\nfunc (%s %s) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error) {", c, methodRecv)
84-
u.p.printf("\n if st.Depth == 0 {")
84+
u.p.printf("\n if st.AllowableDepth == 0 {")
8585
u.p.printf("\n err = msgp.ErrMaxDepthExceeded{}")
8686
u.p.printf("\n return")
8787
u.p.printf("\n }")
88-
u.p.printf("\n st.Depth--")
88+
u.p.printf("\n st.AllowableDepth--")
8989
next(u, p)
9090
u.p.print("\no = bts")
9191

0 commit comments

Comments
 (0)