diff --git a/pb.c b/pb.c index 34bf59c..6d8a777 100755 --- a/pb.c +++ b/pb.c @@ -1728,7 +1728,7 @@ static void lpb_encode_onefield(lpb_Env *e, const pb_Type *t, const pb_Field *f, else if (f->repeated) lpbE_repeated(e, f, idx); else if (!f->type || !f->type->is_dead) - lpbE_tagfield(e, f, t->is_proto3 && !f->oneof_idx, idx); + lpbE_tagfield(e, f, t->is_proto3 && !f->oneof_idx && f->type_id != PB_Tmessage, idx); } static void lpbE_encode(lpb_Env *e, const pb_Type *t, int idx) {