Merge branch 'gencode' into gencode2

pull/13171/head
Joshua Haberman 8 years ago
commit 717a030083
  1. 3
      upb/msg.c

@ -699,12 +699,15 @@ size_t upb_msg_sizeof(const upb_msglayout *l) {
upb_msg *upb_msg_init(void *mem, const upb_msglayout *l, upb_alloc *a) {
upb_msg *msg = VOIDPTR_AT(mem, upb_msg_internalsize(l));
/* Initialize normal members. */
if (l->data.default_msg) {
memcpy(msg, l->data.default_msg, l->data.size);
} else {
memset(msg, 0, l->data.size);
}
/* Initialize internal members. */
upb_msg_getinternal(msg)->alloc = a;
if (l->data.extendable) {

Loading…
Cancel
Save