Joshua Haberman
be7dfeba6b
Added GitHub Action to test for clang-format.
3 years ago
Joshua Haberman
31f7e2a261
Added C++ test for the bug.
3 years ago
Bernardo Bruning
a110d80186
Remove hardcode sizes in buffer and increase buffer to 128
3 years ago
Bernardo Bruning
204971e5db
Remove memory leak into tests
3 years ago
Joshua Haberman
032400a03e
Fixed data corruption when total hasbits are a power of two.
3 years ago
Bernardo Bruning
7f3f0a24f5
Change size of buffer json
3 years ago
Bernardo Bruning
4a3a7d9777
Introduce tests to encode and decode json
3 years ago
Joshua Haberman
c5f6ca1122
Added extra braces to silence compiler warning.
3 years ago
Joshua Haberman
0d0f535c9f
Remove old testing framework.
3 years ago
Joshua Haberman
94ce6a35c2
test_table
3 years ago
Joshua Haberman
738b1d6d9c
test_cpp
3 years ago
Joshua Haberman
4e97915fde
Converted test_generated_code.c to gtest.
3 years ago
Joshua Haberman
cd214fe73d
upb_TextEncode.
3 years ago
Joshua Haberman
0c541f3305
Single encode.
3 years ago
Joshua Haberman
72af9dc0cc
Switch to a single upb_Decode.
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
Stan Hu
053567fd32
Fix conformance test getting stuck on big-endian system
...
The output size is stored as `size_t`, a 64-bit value. However, on a
big-endian system this would be truncated to 0 since the low memory
addresses wold be sent.
To fix this, we cast the `size_t` to `uint32_t` and send that. Note that
calling `htonl()` would also work, but casting is simpler and does not
require including platform-specific header files.
Note that the tests now run, but there are 59 unexpected failures.
Closes https://github.com/protocolbuffers/upb/issues/446
3 years ago
Joshua Haberman
3d437bbcab
Some pre-PR fixes.
3 years ago
Joshua Haberman
ce012b7b55
Added support for extensions.
3 years ago
Joshua Haberman
36485c0a40
Updated rules_fuzzing which brings GCC compatibility.
...
The fix we are pulling in is: https://github.com/bazelbuild/rules_fuzzing/pull/177
3 years ago
Joshua Haberman
975ea595f8
Fleshed out DESIGN.md a bit more.
3 years ago
Joshua Haberman
5c28ab6b2c
Implemented upb_enumvaldef, for storing information about enumvals.
4 years ago
Joshua Haberman
a669587817
Fixed the edge case where rounding up causes overflow.
4 years ago
Joshua Haberman
e83aeba595
Align arena initial block to ensure allocations are aligned.
4 years ago
Joshua Haberman
f098230df8
Exclude fuzz test from non-Clang compilers.
4 years ago
Joshua Haberman
f5796aa607
Updated Bazel fuzzing to use the newest fuzz rules.
4 years ago
Joshua Haberman
e8ba2a1899
Added a fix for locales that output ',' as decimal separator.
4 years ago
Joshua Haberman
9482957425
Enforce that filenames are unique when loaded into symtab.
...
This brings upb into line with C++. PHP already checks this
internally, so this should not be an issue there. Ruby on the
other hand does not currently check this, so this change will
cause our Ruby implementation to reject some programs that
would otherwise have been accepted.
4 years ago
Joshua Haberman
3881393907
Renamed .int.h to _internal.h, for greater clarity.
4 years ago
Matt Kulukundis
da4b75b979
Fix build rules for more restrive deps checks
...
- add msg.int.h access for generated files
- actually declare reflective/non as different things
4 years ago
Joshua Haberman
823eb09694
Update all 2011 dates to 2021.
4 years ago
Joshua Haberman
e59d2c8fa7
Added license headers to all files.
4 years ago
Matt Kulukundis
6481f6319e
Spell out deps explicitly
...
Google internal bazel is more strict about deps, so both reflection and
non need to be spelled out explicitly.
4 years ago
Matt Kulukundis
2e83d5c98f
Remove unused file test_util.h
4 years ago
Matt Kulukundis
7876639e50
remove unused macro
4 years ago
Matt Kulukundis
5b97df91dd
Restrict fuse to matching block_alloc
4 years ago
Matt Kulukundis
d9a0c58108
Allow arena fuse to fail
...
Track initial blocks to avoid having fuse operate on arenas that cannot
be fused.
4 years ago
Joshua Haberman
63ad3db980
Fixed "NULL + 0" UB in JSON encoder and decoder.
4 years ago
Joshua Haberman
add9b12f18
Fixed quadratic memory usage in upb_array_append().
...
We were erroneously calling realloc() instead of resize(),
forcing the entire array to be reallocated for every array
append.
4 years ago
Joshua Haberman
c358829c76
Now that handlers are gone, cleaned up table to use arenas exclusively.
...
Also cleaned up some cruft from table.
4 years ago
Joshua Haberman
f7ed1f27a3
Support non-zero minutes in the timestamp offset for JSON.
4 years ago
Joshua Haberman
f5d2d55007
Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name.
...
This is possible now that all users have been migrated to the new
upb_msg APIs.
4 years ago
Joshua Haberman
9175989431
Bugfix for arena cleanup list when passing to upb_decode().
4 years ago
Joshua Haberman
5e550e88f8
Added API for getting fielddef default as a upb_msgval.
4 years ago
Esun Kim
9b020d8f65
Optimize calls to std::string::find() and friends for a single char.
4 years ago
Joshua Haberman
6c30b5fe73
Fixed upb encoder for field numbers > 2**28.
...
The encoder was improperly sign-extending the tag to 64 bits.
4 years ago
Joshua Haberman
e9551022c1
Added depth limit checking to upb_encode().
...
This can catch infinite recursion due to loops,
or just excessively deep message trees.
The depth limit is configurable, but defaults to 64.
4 years ago
Joshua Haberman
7a17493269
Removed print debugging.
4 years ago
Joshua Haberman
695b7f4617
Added code to test UPB_JSONENC_EMITDEFAULTS.
4 years ago