diff --git a/upb/conformance/BUILD b/upb/conformance/BUILD index 9630c016bc..e645cc202b 100644 --- a/upb/conformance/BUILD +++ b/upb/conformance/BUILD @@ -73,6 +73,7 @@ cc_binary( "//editions:test_messages_proto3_editions_upbdefs", "//upb:base", "//upb:json", + "//upb:message", "//upb:port", "//upb:reflection", "//upb:text", @@ -127,6 +128,7 @@ cc_binary( "//editions:test_messages_proto3_editions_upbdefs", "//upb:base", "//upb:json", + "//upb:message", "//upb:port", "//upb:reflection", "//upb:text", diff --git a/upb/conformance/conformance_upb.c b/upb/conformance/conformance_upb.c index 349d9ec83f..28c713e8c5 100644 --- a/upb/conformance/conformance_upb.c +++ b/upb/conformance/conformance_upb.c @@ -23,6 +23,7 @@ #include "upb/base/upcast.h" #include "upb/json/decode.h" #include "upb/json/encode.h" +#include "upb/message/message.h" #include "upb/reflection/message.h" #include "upb/text/encode.h" #include "upb/wire/decode.h" @@ -68,6 +69,7 @@ typedef struct { } ctx; bool parse_proto(upb_Message* msg, const upb_MessageDef* m, const ctx* c) { + UPB_ASSERT(!upb_Message_IsFrozen(msg)); upb_StringView proto = conformance_ConformanceRequest_protobuf_payload(c->request); if (upb_Decode(proto.data, proto.size, msg, upb_MessageDef_MiniTable(m), NULL, @@ -117,6 +119,7 @@ void serialize_text(const upb_Message* msg, const upb_MessageDef* m, } bool parse_json(upb_Message* msg, const upb_MessageDef* m, const ctx* c) { + UPB_ASSERT(!upb_Message_IsFrozen(msg)); upb_StringView json = conformance_ConformanceRequest_json_payload(c->request); upb_Status status; int opts = 0; @@ -172,6 +175,7 @@ void serialize_json(const upb_Message* msg, const upb_MessageDef* m, } bool parse_input(upb_Message* msg, const upb_MessageDef* m, const ctx* c) { + UPB_ASSERT(!upb_Message_IsFrozen(msg)); switch (conformance_ConformanceRequest_payload_case(c->request)) { case conformance_ConformanceRequest_payload_protobuf_payload: return parse_proto(msg, m, c);