diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-01-01 17:31:14 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-01-01 17:31:14 -0800 |
commit | ece08710a64e09baf4bdcb71752ce20ff1d4a757 (patch) | |
tree | 4aec32670cccdf6dfeacf385eedca10f8f1292ed /src/upb_data.h | |
parent | 2fdc9df97eab06f2b42c1a9a87bc01d5e9feedd7 (diff) |
Bugfixes: descriptorgen works without leaks!
Diffstat (limited to 'src/upb_data.h')
-rw-r--r-- | src/upb_data.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/upb_data.h b/src/upb_data.h index 2a7940e..6dc343b 100644 --- a/src/upb_data.h +++ b/src/upb_data.h @@ -374,14 +374,14 @@ void _upb_array_free(upb_array *a, struct upb_fielddef *f); INLINE union upb_value_ptr _upb_array_getptr(upb_array *a, struct upb_fielddef *f, upb_arraylen_t elem) { - assert(elem < upb_array_len(a)); size_t type_size = upb_type_info[f->type].size; union upb_value_ptr p = {._void = &a->common.elements.uint8[elem * type_size]}; return p; } INLINE union upb_value upb_array_get(upb_array *a, struct upb_fielddef *f, - int elem) { + upb_arraylen_t elem) { + assert(elem < upb_array_len(a)); return upb_value_read(_upb_array_getptr(a, f, elem), f->type); } |