summaryrefslogtreecommitdiff
path: root/upb/bindings/lua/msg.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2017-07-04 17:02:48 -0700
committerJoshua Haberman <jhaberman@gmail.com>2017-07-04 17:02:48 -0700
commit9cb10577fcefa3ed004e0bbdc61e6238e8137e3c (patch)
treee270ff7b0f782dadf2942f6816b071aa2a134e21 /upb/bindings/lua/msg.c
parent76fcdd2ee92e8f7852f96ccd49fe776236ae4e60 (diff)
First version of a real C codegen for upb.
Also includes an implementation of the conformance tests to display what the API usage will be like. There is still a lot to do, and things that are broken (oneofs, repeated fields, etc), but it's a good start.
Diffstat (limited to 'upb/bindings/lua/msg.c')
-rw-r--r--upb/bindings/lua/msg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/upb/bindings/lua/msg.c b/upb/bindings/lua/msg.c
index 41163bc..dc8420f 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(ptr, len);
+ return upb_msgval_str(upb_stringview_make(ptr, len));
}
case UPB_TYPE_MESSAGE:
UPB_ASSERT(lmsgclass);
@@ -1014,7 +1014,7 @@ static int lupb_msg_index(lua_State *L) {
if (upb_msg_has(lmsg->msg, field_index, l)) {
upb_msgval val = upb_msg_get(lmsg->msg, field_index, l);
lua_pop(L, 1);
- lua_pushlstring(L, val.str.ptr, val.str.len);
+ lua_pushlstring(L, val.str.data, val.str.size);
lupb_uservalseti(L, 1, lupb_fieldindex(f), -1);
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback