Bug #76762 [Opn->Csd]: protobuf int32???????????????js????????????
[email protected] Thu, 26 Aug 2021 11:04:29 +0000
| Newsgroups | php.pecl.dev |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=76762&edit=1 ID: 76762 Updated by: [email protected] Reported by: 1339796113 at qq dot com Summary: protobuf int32默认值导致js解析失败 -Status: Open +Status: Closed Type: Bug Package: PECL Operating System: linux PHP Version: 7.2.9 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: If this is still unresolved, please report it at <https://github.com/protocolbuffers/protobuf/issues>. Previous Comments: ------------------------------------------------------------------------ [2018-08-18 08:52:14] 1339796113 at qq dot com Description: ------------ int32 默认值0 map<int32, int64> 当map类型计算长度的时候由于int32 默认值为0 map的key为0时 导致计算长度不一样 T(UPB_TYPE_FLOAT, float, float, 0.0) T(UPB_TYPE_DOUBLE, double, double, 0.0) T(UPB_TYPE_BOOL, bool, uint8_t, 0) T(UPB_TYPE_ENUM, int32, int32_t, 0) T(UPB_TYPE_INT32, int32, int32_t, -1) T(UPB_TYPE_UINT32, uint32, uint32_t, 0) T(UPB_TYPE_INT64, int64, int64_t, 0) T(UPB_TYPE_UINT64, uint64, uint64_t, 0) encode_decode.c 1127行 T(UPB_TYPE_INT32, int32, int32_t, -1) 修改为这个即可 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76762&edit=1