diff --git a/upb/bindings/lua/msg.c b/upb/bindings/lua/msg.c index dc8420f538..e468ace285 100644 --- a/upb/bindings/lua/msg.c +++ b/upb/bindings/lua/msg.c @@ -434,7 +434,7 @@ static upb_msgval lupb_tomsgval(lua_State *L, upb_fieldtype_t type, int narg, case UPB_TYPE_BYTES: { size_t len; const char *ptr = lupb_checkstring(L, narg, &len); - return upb_msgval_str(upb_stringview_make(ptr, len)); + return upb_msgval_makestr(ptr, len); } case UPB_TYPE_MESSAGE: UPB_ASSERT(lmsgclass); diff --git a/upb/msg.h b/upb/msg.h index 7026a50edb..dd25542ccf 100644 --- a/upb/msg.h +++ b/upb/msg.h @@ -126,6 +126,7 @@ UPB_INLINE upb_stringview upb_stringview_make(const char *data, size_t size) { #define UPB_STRINGVIEW_INIT(ptr, len) {ptr, len} + /** upb_msgval ****************************************************************/ /* A union representing all possible protobuf values. Used for generic get/set