Commit graph

8 commits

Author SHA1 Message Date
Mike Kruskal
ce6dbe478a Setup fix for python/upb for the enforcement of closed enums in editions.
This will be a breaking change in the 30.0 release.

PiperOrigin-RevId: 676683430
2024-09-19 21:29:58 -07:00
Eric Salo
e1a19ba8bb upb: add 'options' arg to upb_Message_IsEqual()
PiperOrigin-RevId: 614707625
2024-03-11 10:16:13 -07:00
Eric Salo
c69ed472cd upb: implement minitable-based field iterators
PiperOrigin-RevId: 605718863
2024-02-09 13:39:18 -08:00
Protobuf Team Bot
9c7d2b9d83 Make the utf8_range implementation just in C
PiperOrigin-RevId: 590961088
2023-12-14 09:25:06 -08:00
Protobuf Team Bot
0fab773c1d Update remainder of upb to new short license style.
PiperOrigin-RevId: 584116886
2023-11-20 13:43:32 -08:00
Joshua Haberman
b0eeb356b8 Fixed Python memory leak in map lookup.
Previously we were allocating memory on the message's arena every time we performed a `map[key]` or `map.get(key)` operation.  This is unnecessary, as the key's data is only needed ephemerally, for the duration of the lookup, and we can therefore alias the Python object's string data instead of copying it.

This required fixing a bug in the convert.c operation.  Previously in the `arena==NULL` case, if the user passes a bytes object instead of a unicode string, the code would return a pointer to a temporary Python object that had already been freed, leading to use-after-free.  I fixed this by referencing the bytes object's data directly, and using utf8_range to verify the UTF-8.

Fixes: https://github.com/protocolbuffers/protobuf/issues/14571
PiperOrigin-RevId: 578563555
2023-11-01 10:34:44 -07:00
Eric Salo
07fba1da07 upb: merge ":collections" into ":message"
PiperOrigin-RevId: 569594353
2023-09-29 14:53:28 -07:00
Adam Cozzette
501ececd39 Reorganize upb file structure
This change moves almost everything in the `upb/` directory up one level, so
that for example `upb/upb/generated_code_support.h` becomes just
`upb/generated_code_support.h`. The only exceptions I made to this were that I
left `upb/cmake` and `upb/BUILD` where they are, mostly because that avoids
conflict with other files and the current locations seem reasonable for now.

The `python/` directory is a little bit of a challenge because we had to merge
the existing directory there with `upb/python/`. I made `upb/python/BUILD` into
the BUILD file for the merged directory, and it effectively loads the contents
of the other BUILD file via `python/build_targets.bzl`, but I plan to clean
this up soon.

PiperOrigin-RevId: 568651768
2023-09-26 14:38:35 -07:00
Renamed from upb/python/convert.c (Browse further)