fix this fuzz

i forgot the prefix the otherwise encode with a zero ooops

go test fuzz v1
[]byte("\x85\x01\x00\x00")
This commit is contained in:
adman
2025-12-25 16:06:03 +01:00
parent b713aa499e
commit 46b929f049
+5
View File
@@ -297,7 +297,12 @@ func RegistryEntryHolderEncoder(g *Generator, varToSet ast.Expr, dataRaw any, na
return
}
knownTypeName := name + "KnownType"
encode0statements, err := g.VisitEncoder(NumLit(0), "varint", name+"Zero")
if err != nil {
return
}
otherwiseEncodeStatements, err := g.VisitEncoder(Ident(knownTypeName), data.Otherwise.Type, name+"Otherwise")
otherwiseEncodeStatements = append(encode0statements, otherwiseEncodeStatements...)
if err != nil {
return
}