Add support for POINTER type in extensions

This commit is contained in:
Petteri Aimonen
2014-12-26 18:23:36 +02:00
parent 980f899dd5
commit 418f7d88b3
3 changed files with 24 additions and 3 deletions

View File

@@ -650,6 +650,14 @@ static bool checkreturn default_extension_decoder(pb_istream_t *stream,
iter.pData = extension->dest;
iter.pSize = &extension->found;
if (PB_ATYPE(field->type) == PB_ATYPE_POINTER)
{
/* For pointer extensions, the pointer is stored directly
* in the extension structure. This avoids having an extra
* indirection. */
iter.pData = &extension->dest;
}
return decode_field(stream, wire_type, &iter);
}