Commit Graph

8247 Commits

Author SHA1 Message Date
Adam Cozzette
13fa25013a Merge branch '3.15.x' into 3.15.x-202103031418 2021-03-03 14:29:11 -08:00
Joshua Haberman
33905ec87b Fixed the Java Lite build. 2021-03-03 12:36:13 -08:00
Adam Cozzette
fd8aabf32d Update protobuf version 2021-03-03 11:37:48 -08:00
Adam Cozzette
e5c067f81b Updated CHANGES.txt and PHP changelog for 3.15.4 release 2021-03-03 11:37:48 -08:00
Antony Dovgal
aa41d9005b read_property() handler is not supposed to return NULL
NULL is never expected as a result of read_property() handler,
it should return &EG(uninitialized_zval) if there is no such property in
the object
2021-03-03 11:32:58 -08:00
Joshua Haberman
4baed791f5
Merge pull request #8362 from tony2001/read_property_crash_fixed
read_property() handler is not supposed to return NULL
2021-03-03 10:14:31 -08:00
Joshua Haberman
cf7d81f88c
Merge pull request #8363 from haberman/ruby-nil-fix
Fixed SEGV when users pass nil messages. This also disallows `nil` in RepeatedField or Map.
2021-03-02 17:26:46 -08:00
Joshua Haberman
7d63b996e1 Removed compatibility test that tries to append "nil" to repeated field. 2021-03-02 15:20:06 -08:00
Joshua Haberman
069f989b48
Merge pull request #8364 from haberman/ruby-memory-footprint
[Ruby] Fixed quadratic memory usage when appending to arrays.
2021-03-02 15:17:13 -08:00
Florian Simon
1add7a7bd6 Create a CMake option to control whether or not RTTI is enabled
This is useful for Conan recipes that build Protobuf, in which
whatever we want to enable has to be enabled in the initial command line.
Without this, the people maintaining the recipe have to patch the CMake
setup of Protobuf before building the binaries.

Closes #5541
2021-03-02 13:47:05 -08:00
Joshua Haberman
88243e45fc [Ruby] Fixed quadratic memory usage when appending to arrays.
The code mistakenly called realloc() instead of resize() on every
array append, causing quadratic memory usage.
2021-03-02 13:37:47 -08:00
Joshua Haberman
dfa54577d6 [Ruby] Fixed SEGV when users pass nil messages. 2021-03-02 12:44:16 -08:00
Antony Dovgal
2e7771d7a0 read_property() handler is not supposed to return NULL
NULL is never expected as a result of read_property() handler,
it should return &EG(uninitialized_zval) if there is no such property in
the object
2021-03-02 22:49:24 +03:00
Yannic
85e5204517 [bazel] Flip --incompatible_use_com_google_googletest 2021-03-02 11:17:52 -08:00
Po-Chuan Hsieh
3172ab8ff9 Fix endian.h location on FreeBSD 2021-03-02 11:10:46 -08:00
Florian Simon
a4e7b97bd6 Create a CMake option to control whether or not RTTI is enabled
This is useful for Conan recipes that build Protobuf, in which
whatever we want to enable has to be enabled in the initial command line.
Without this, the people maintaining the recipe have to patch the CMake
setup of Protobuf before building the binaries.

Closes #5541
2021-03-02 11:09:28 -08:00
Anton Danielsson
630028a4c6 Fix cmake install on iOS
Fixes:
INSTALL TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
2021-03-01 17:32:31 -08:00
Romain Geissler
9d203953a9 Fix gcc error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
This fixes the following build error:
In file included from no_warning_test.cc:7:
../../src/google/protobuf/parse_context.h: In instantiation of 'const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]':
../../src/google/protobuf/parse_context.h:366:70:   required from here
../../src/google/protobuf/stubs/logging.h:161:48: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
  161 | #define GOOGLE_CHECK_GE(A, B) GOOGLE_CHECK((A) >= (B))
      |                                                ^
../../src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro 'GOOGLE_LOG_IF'
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
../../src/google/protobuf/stubs/logging.h:161:31: note: in expansion of macro 'GOOGLE_CHECK'
  161 | #define GOOGLE_CHECK_GE(A, B) GOOGLE_CHECK((A) >= (B))
      |                               ^~~~~~~~~~~~
../../src/google/protobuf/stubs/logging.h:201:26: note: in expansion of macro 'GOOGLE_CHECK_GE'
  201 | #define GOOGLE_DCHECK_GE GOOGLE_CHECK_GE
      |                          ^~~~~~~~~~~~~~~
../../src/google/protobuf/parse_context.h:351:7: note: in expansion of macro 'GOOGLE_DCHECK_GE'
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
2021-03-01 16:38:00 -08:00
Yannic
88367afa1f
[C++] Delete StringPiecePod (#8353)
Protobuf no longer supports C++ < 11, so this type is no longer
required.
2021-03-01 16:29:00 -08:00
Yuriy Chernyshov
e9091e6d8c
Fix some constness / char literal issues being found by MSVC standard conforming mode (#8344)
* Fix some constness / char literal issues being found by MSVC standard conforming mode

* Switch to const_cast from C-style casts
2021-03-01 12:59:39 -08:00
Lukas Fittl
2c354c6626 Ruby: Add support for proto3 json_name in compiler and field definitions 2021-03-01 00:25:18 -08:00
Joshua Haberman
f645c7ed07 Fixed spelling errors surfaced by CodeSpell. 2021-02-26 10:54:13 -08:00
Joshua Haberman
d6f0c9b187 Updated changelog. 2021-02-26 10:45:41 -08:00
Joshua Haberman
899c276248 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-02-26 10:37:38 -08:00
Joshua Haberman
9df42757f9 Sync from Piper @359788468
PROTOBUF_SYNC_PIPER
2021-02-26 10:37:37 -08:00
Adam Cozzette
8080bebf1f
Merge pull request #8348 from acozzette/3.15.x-202102251545
Merge 3.15.x into master
2021-02-25 17:02:41 -08:00
Adam Cozzette
e54403190b Merge branch '3.15.x' into 3.15.x-202102251545 2021-02-25 15:54:09 -08:00
Adam Cozzette
983d115bd9 Update protobuf version 2021-02-25 09:20:20 -08:00
Adam Cozzette
eb542e606b Updated CHANGES.txt for 3.15.3 release 2021-02-25 09:19:24 -08:00
Joshua Haberman
80ec787928
Merge pull request #8341 from haberman/ruby-2.5-gc
Ruby <2.7now uses WeakMap too, which prevents memory leaks.
2021-02-24 17:49:02 -08:00
Adam Cozzette
a6c28fb207
Merge pull request #8338 from acozzette/3.15.x-202102231541
Merge 3.15.x into master
2021-02-24 16:46:27 -08:00
Joshua Haberman
9879f423ff Ruby <2.7now uses WeakMap too, which prevents memory leaks.
Ruby <2.7 does not allow non-finalizable objects to be WeakMap
keys: https://bugs.ruby-lang.org/issues/16035

We work around this by using a secondary map for Ruby <2.7 which
maps the non-finalizable integer to a distinct object.

For now we accept that the entries in the secondary map wil never
be collected.  If this becomes a problem we can perform a GC pass
every so often that looks at the contents of the object cache to
decide what can be deleted from the secondary map.
2021-02-24 16:41:35 -08:00
Adam Cozzette
d8254a67ce Merge branch '3.15.x' into 3.15.x-202102231541 2021-02-23 15:51:34 -08:00
Adam Cozzette
d7e943b8d2 Update protobuf version 2021-02-23 13:21:42 -08:00
Adam Cozzette
1af4657b80 Updated CHANGES.txt 2021-02-23 13:21:42 -08:00
Yuriy Chernyshov
09f94e7311 Fix PROTOBUF_CONSTINIT macro redifinition
The #ifdef block is duplicated with the above (which was fixed in 3.15.1).

It would be great to have this fix backported to 3.15.1 (and released as 3.15.2).
2021-02-23 13:21:27 -08:00
Adam Cozzette
a43ddfbd56
Merge pull request #8323 from georgthegreat/patch-1
Fix PROTOBUF_CONSTINIT macro redefinition
2021-02-23 11:20:03 -08:00
Joshua Haberman
2ff31d34aa
Merge pull request #8330 from haberman/rubyfix
[Ruby] Fix for FieldDescriptor.get(msg).
2021-02-22 18:19:44 -08:00
Joshua Haberman
4e3ea74e42 [Ruby] Fix for FieldDescriptor.get(msg).
This fix is similar to the previous bug found in
Message.[]. The fix is the same: we need to handle
arrays and maps properly.

Fixes: https://github.com/protocolbuffers/protobuf/issues/8325
2021-02-22 17:14:46 -08:00
Adam Cozzette
326ea555ba
Merge pull request #8329 from acozzette/merge-3-15-x
Merge 3.15.x into master
2021-02-22 12:29:27 -08:00
Adam Cozzette
6e84adc9ff Merge branch '3.15.x' into merge-3-15-x 2021-02-22 11:03:32 -08:00
Thomas Van Lenten
5911099659 Move the class map to a CFDictionary.
Since the keys are `Class`-s, there's no need to hash/copy/etc. them. This
avoids causing `+initialize` on the classes just when building up a registry.
2021-02-22 13:08:32 -05:00
Alexander Reynolds
393e453033 Add MethodDescriptor.CopyToProto() 2021-02-22 02:25:37 -08:00
Yuriy Chernyshov
2e47e3bc64
Fix PROTOBUF_CONSTINIT macro redifinition
The #ifdef block is duplicated with the above (which was fixed in 3.15.1).

It would be great to have this fix backported to 3.15.1 (and released as 3.15.2).
2021-02-20 12:09:52 +03:00
Adam Cozzette
052dc799d2 Update protobuf version 2021-02-19 15:12:24 -08:00
Adam Cozzette
24d8a554ea Updated CHANGES.txt 2021-02-19 15:12:24 -08:00
Adam Cozzette
d721e36ecc Made some small fixes for MinGW and for C++20 with GCC
Our use of constinit does not seem to work with GCC yet (see
https://github.com/protocolbuffers/protobuf/issues/8310), so this
commit disables it on GCC for now.

This commit also updates mutex.h to work around the fact that MinGW's
std::mutex apparently does not have a constexpr constructor. We already
have this kind of workaround for MSVC, so we can just use the same
workaround.
2021-02-19 15:11:34 -08:00
Joshua Haberman
b12ab0cf53
Merge pull request #8320 from haberman/ruby-duration-fix
[Ruby] Fix for truncating behavior when converting Float to Duration.
2021-02-19 15:03:42 -08:00
Joshua Haberman
3b3aac95a6 [Ruby] Fix for truncating behavior when converting Float to Duration. 2021-02-19 13:58:19 -08:00
Elliotte Rusty Harold
947e2e189a
deps: update JUnit and Truth 2021-02-19 21:36:09 +00:00