summaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-12-26 18:23:36 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-12-26 18:23:36 +0200
commit418f7d88b3f58603fe03d0060b8aaba905ca56c8 (patch)
treeea85e1ecbeaab94a28e60141577faa27b0173011 /pb_decode.c
parent980f899dd5ca1b4201536cdb56a723ba7777d82c (diff)
Add support for POINTER type in extensions
Diffstat (limited to 'pb_decode.c')
-rw-r--r--pb_decode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pb_decode.c b/pb_decode.c
index d1efd1b5..26d7c2b7 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -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);
}