Joshua Haberman
4a01577cce
Two fixes to upb/def.c
...
1. Be tolerant of messages that extend more than one message set.
2. Implemented missing upb_MethodDef_Index() method.
3 years ago
Joshua Haberman
ecc8bae4ce
Fix for proto2 files that use proto3 enums.
3 years ago
Joshua Haberman
7984ebf52d
Fixed error message.
3 years ago
Joshua Haberman
9bb1787f27
Added fuzzing of symtab build, and fixed a handful of minor bugs.
3 years ago
Joshua Haberman
992448eefe
Addressed PR comments.
3 years ago
Joshua Haberman
9715597895
Fixed clang-format.
3 years ago
Joshua Haberman
2e141b24fc
Addressed PR comments.
3 years ago
Joshua Haberman
b11e161ebb
Fixed UBSAN error.
3 years ago
Joshua Haberman
85072ce04e
Fixed a bug in enum layout generation.
3 years ago
Joshua Haberman
65a85a63c8
Fixed two bugs with proto2 enums:
...
1. The mask was getting improperly truncated for values 32-63.
2. We were not handling duplicated enum values.
3 years ago
Joshua Haberman
c56fe27f88
Fix mistake in previous rename: upb_MessageDef_FindFieldByNameWithSize.
3 years ago
Joshua Haberman
032400a03e
Fixed data corruption when total hasbits are a power of two.
3 years ago
Joshua Haberman
606308c639
Added back missing underscore.
3 years ago
Joshua Haberman
75b6291e40
Renamed upb_FieldType_* -> kUpb_FieldType_*
3 years ago
Joshua Haberman
392531c14f
Fixed test by implementing FindMethodByName().
3 years ago
Joshua Haberman
fcf1db32b1
Fixed a few extraneous wrappings.
3 years ago
Joshua Haberman
499c2cc8b1
upb_extreg, upb_msg
3 years ago
Joshua Haberman
1c955f37ce
Mass API rename and clang-reformat ( #485 )
...
* Wave 1: upb_fielddef.
* upb_fielddef itself.
* upb_oneofdef.
* upb_msgdef.
* ExtensionRange.
* upb_enumdef
* upb_enumvaldef
* upb_filedef
* upb_methoddef
* upb_servicedef
* upb_symtab
* upb_defpool_init
* upb_wellknown and upb_syntax_t
* Some constants.
* upb_status
* upb_strview
* upb_arena
* upb.h constants
* reflection
* encode
* JSON decode.
* json encode.
* msg_internal.
* Formatted with clang-format.
* Some naming fixups and comment reformatting.
* More refinements.
* A few more stragglers.
* Fixed PyObject_HEAD with semicolon. Removed TODO entries.
3 years ago
Joshua Haberman
00c106f551
Addressed PR comments.
3 years ago
Joshua Haberman
7a24340a26
Fixed some more tests.
3 years ago
Joshua Haberman
fc725be5bc
Implemented proper unescaping of bytes defaults.
3 years ago
Joshua Haberman
aee30144cc
Fixed a couple bugs.
3 years ago
Joshua Haberman
54b605026d
Fixed a bug in ListFields().
3 years ago
Joshua Haberman
d2283ed219
Verify extension ranges, and addressed PR comments.
3 years ago
Joshua Haberman
df77ca5dbb
Check extension field numbers against extension ranges.
...
This makes extension checking more strict in most cases.
However it also fixes a bug with MessageSet where we were being
too strict. MessageSet allows larger extension numbers than
normal extensions do.
3 years ago
Joshua Haberman
7576a3bfc1
Avoid NULL + 0 when adding a list of 0 extensions.
3 years ago
Joshua Haberman
1845997498
Added comments.
3 years ago
Stan Hu
53250c8504
Fix encoding/decoding for def-to-proto on big-endian systems
...
In a big-endian system, the 64-bit value of 1 is represented as:
```
0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1
```
However, when `d.int32_val` is used, this truncates this and takes the
first four bytes:
```
0x0 0x0 0x0 0x0
```
As a result, we lose the value of 1 from this truncation and the value
beocmes 0. This doesn't happen in a little-endian system because the 1
is in the lowest memory address, so truncating the value to 32 bits
doesn't change anything.
Previously the DefToProto test was failing on a big-endian system
because this truncation caused the key to be incorrectly set to 0.
We now use the type-specific functions
(e.g. `upb_fielddef_defaultint32`) to do this conversion.
Closes https://github.com/protocolbuffers/upb/issues/442
3 years ago
Joshua Haberman
d0795a29d9
Test for def_to_proto is working.
3 years ago
Joshua Haberman
f7980b7ed1
Restructured for simplicity and fixed fasttable parser.
3 years ago
Joshua Haberman
3d437bbcab
Some pre-PR fixes.
3 years ago
Joshua Haberman
7771a0515b
Addressed PR comments.
3 years ago
Joshua Haberman
16f763e4d6
Addressed PR comments.
3 years ago
Joshua Haberman
9d26c706e0
Removed dependency on popcount() intrinsic.
3 years ago
Joshua Haberman
7907ed913b
Expanded the test to cover packed fields also.
3 years ago
Joshua Haberman
401e1747b5
Addressed PR feedback.
3 years ago
Joshua Haberman
cc03669a17
Several changes to defs.
...
Biggest/key changes:
1. Defs are now nested per the .proto file syntax.
2. Options are parsed and vended.
3 years ago
Joshua Haberman
2484d12c1c
Addressed PR comments.
3 years ago
Joshua Haberman
8c916941b0
MSET -> MSGSET
3 years ago
Joshua Haberman
6f89034249
Implemented support for MessageSet.
3 years ago
Joshua Haberman
b1bbbdd4e7
Addressed PR comments.
3 years ago
Joshua Haberman
ce012b7b55
Added support for extensions.
3 years ago
Joshua Haberman
3366d02f04
Addressed PR comments.
3 years ago
Joshua Haberman
5c28ab6b2c
Implemented upb_enumvaldef, for storing information about enumvals.
3 years ago
Joshua Haberman
53fba823de
Added missing upb_symtab_lookupext() function.
3 years ago
Joshua Haberman
cdd6434a31
Introduced upb_extreg and plumbed it into decoder.
4 years ago
Joshua Haberman
58e158c6fa
Changed mini-table to use a custom "mode" instead of descriptor's "label."
4 years ago
Joshua Haberman
807e7fe9e2
Fixed dense_below logic to be order-independent and consistent between def.c and codegen.
4 years ago
Joshua Haberman
2e8a122fc0
Changed dense_below calculation to use UINT8_MAX as the constant.
4 years ago
Joshua Haberman
6394894b6e
Addressed PR comments.
4 years ago