Merge branch 'stringview' into gencode3

pull/13171/head
Joshua Haberman 7 years ago
commit 2e01793ded
  1. 2
      upb/bindings/lua/msg.c
  2. 1
      upb/msg.h

@ -434,7 +434,7 @@ static upb_msgval lupb_tomsgval(lua_State *L, upb_fieldtype_t type, int narg,
case UPB_TYPE_BYTES: { case UPB_TYPE_BYTES: {
size_t len; size_t len;
const char *ptr = lupb_checkstring(L, narg, &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: case UPB_TYPE_MESSAGE:
UPB_ASSERT(lmsgclass); UPB_ASSERT(lmsgclass);

@ -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} #define UPB_STRINGVIEW_INIT(ptr, len) {ptr, len}
/** upb_msgval ****************************************************************/ /** upb_msgval ****************************************************************/
/* A union representing all possible protobuf values. Used for generic get/set /* A union representing all possible protobuf values. Used for generic get/set

Loading…
Cancel
Save