aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/upb.c
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-06-30 12:14:09 -0700
committerGitHub <noreply@github.com>2017-06-30 12:14:09 -0700
commitecca6ea95d56a6f70ff7b223ec3f904758acc8b1 (patch)
tree728f4aff0d5f00c78a741cf737ea6de58f4ba645 /php/ext/google/protobuf/upb.c
parent5a52b3588d35d2fa0b9ce4eda5630546966a26b4 (diff)
downloadprotobuf-ecca6ea95d56a6f70ff7b223ec3f904758acc8b1.tar.gz
protobuf-ecca6ea95d56a6f70ff7b223ec3f904758acc8b1.tar.bz2
protobuf-ecca6ea95d56a6f70ff7b223ec3f904758acc8b1.zip
Add json encode/decode for php. (#3226)
* Add json encode/decode for php. * Fix php conformance test on 32-bit machines. * Fix conformance test for c extension. * Fix comments
Diffstat (limited to 'php/ext/google/protobuf/upb.c')
-rw-r--r--php/ext/google/protobuf/upb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/upb.c b/php/ext/google/protobuf/upb.c
index cac2b401..d701dcba 100644
--- a/php/ext/google/protobuf/upb.c
+++ b/php/ext/google/protobuf/upb.c
@@ -2308,6 +2308,9 @@ bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status) {
bool ret;
n = upb_filedef_defcount(file);
+ if (n == 0) {
+ return true;
+ }
defs = upb_gmalloc(sizeof(*defs) * n);
if (defs == NULL) {