Sfoglia il codice sorgente

Merge branch 'master' of https://github.com/protocolbuffers/protobuf into sync201904090622

Hao Nguyen 6 anni fa
parent
commit
6dc9832aab
100 ha cambiato i file con 2320 aggiunte e 1079 eliminazioni
  1. 19 2
      BUILD
  2. 1 1
      CHANGES.txt
  3. 1 1
      Protobuf.podspec
  4. 1 1
      cmake/extract_includes.bat.in
  5. 1 1
      cmake/libprotobuf-lite.cmake
  6. 5 3
      configure.ac
  7. 48 0
      conformance/binary_json_conformance_suite.cc
  8. 2 0
      conformance/failure_list_php.txt
  9. 0 1
      conformance/failure_list_ruby.txt
  10. 0 1
      conformance/failure_list_ruby_mac.txt
  11. 1 1
      csharp/Google.Protobuf.Tools.nuspec
  12. 51 50
      csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
  13. BIN
      csharp/src/Google.Protobuf.Test/testprotos.pb
  14. 1 1
      csharp/src/Google.Protobuf/Google.Protobuf.csproj
  15. 1 1
      docs/third_party.md
  16. 1 1
      java/bom/pom.xml
  17. 1 1
      java/core/pom.xml
  18. 1 1
      java/pom.xml
  19. 1 1
      java/util/pom.xml
  20. 1 1
      js/gulpfile.js
  21. 3 3
      js/package.json
  22. 1 1
      kokoro/linux/dockerfile/push_testing_images.sh
  23. 33 0
      kokoro/linux/dockerfile/test/javascript/Dockerfile
  24. 2 1
      kokoro/linux/javascript/build.sh
  25. 1 1
      kokoro/macos/prepare_build_macos_rc
  26. 2 2
      objectivec/GPBMessage.h
  27. 2 2
      php/ext/google/protobuf/def.c
  28. 18 4
      php/ext/google/protobuf/package.xml
  29. 1 1
      php/ext/google/protobuf/protobuf.h
  30. 308 230
      php/ext/google/protobuf/upb.c
  31. 117 73
      php/ext/google/protobuf/upb.h
  32. 0 1
      php/src/Google/Protobuf/Internal/DescriptorProto.php
  33. 0 1
      php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php
  34. 0 1
      php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php
  35. 0 1
      php/src/Google/Protobuf/Internal/EnumDescriptorProto.php
  36. 0 1
      php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php
  37. 0 1
      php/src/Google/Protobuf/Internal/EnumOptions.php
  38. 0 1
      php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php
  39. 0 1
      php/src/Google/Protobuf/Internal/EnumValueOptions.php
  40. 0 1
      php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php
  41. 0 1
      php/src/Google/Protobuf/Internal/FieldDescriptorProto.php
  42. 0 1
      php/src/Google/Protobuf/Internal/FieldOptions.php
  43. 0 1
      php/src/Google/Protobuf/Internal/FileDescriptorProto.php
  44. 0 1
      php/src/Google/Protobuf/Internal/FileDescriptorSet.php
  45. 0 1
      php/src/Google/Protobuf/Internal/FileOptions.php
  46. 0 1
      php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php
  47. 0 1
      php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php
  48. 0 1
      php/src/Google/Protobuf/Internal/MessageOptions.php
  49. 0 1
      php/src/Google/Protobuf/Internal/MethodDescriptorProto.php
  50. 0 1
      php/src/Google/Protobuf/Internal/MethodOptions.php
  51. 0 1
      php/src/Google/Protobuf/Internal/OneofDescriptorProto.php
  52. 0 1
      php/src/Google/Protobuf/Internal/OneofOptions.php
  53. 0 1
      php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php
  54. 0 1
      php/src/Google/Protobuf/Internal/ServiceOptions.php
  55. 0 1
      php/src/Google/Protobuf/Internal/SourceCodeInfo.php
  56. 0 1
      php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php
  57. 0 1
      php/src/Google/Protobuf/Internal/UninterpretedOption.php
  58. 0 1
      php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php
  59. 17 0
      php/tests/encode_decode_test.php
  60. 1 0
      php/tests/proto/test.proto
  61. 2 2
      protoc-artifacts/build-protoc.sh
  62. 1 1
      protoc-artifacts/pom.xml
  63. 1 1
      python/google/protobuf/__init__.py
  64. 1 0
      ruby/.gitignore
  65. 5 0
      ruby/Rakefile
  66. 36 1
      ruby/ext/google/protobuf_c/encode_decode.c
  67. 68 2
      ruby/ext/google/protobuf_c/message.c
  68. 33 3
      ruby/ext/google/protobuf_c/storage.c
  69. 439 382
      ruby/ext/google/protobuf_c/upb.c
  70. 715 113
      ruby/ext/google/protobuf_c/upb.h
  71. 1 1
      ruby/google-protobuf.gemspec
  72. 24 0
      ruby/tests/basic_test.proto
  73. 24 0
      ruby/tests/basic_test_proto2.proto
  74. 231 0
      ruby/tests/common_tests.rb
  75. 4 1
      ruby/travis-test.sh
  76. 2 2
      src/Makefile.am
  77. 2 2
      src/google/protobuf/any.pb.h
  78. 4 4
      src/google/protobuf/api.pb.h
  79. 1 1
      src/google/protobuf/compiler/command_line_interface.cc
  80. 1 1
      src/google/protobuf/compiler/cpp/cpp_message.cc
  81. 1 16
      src/google/protobuf/compiler/cpp/cpp_message_field.cc
  82. 2 4
      src/google/protobuf/compiler/php/php_generator.cc
  83. 5 5
      src/google/protobuf/compiler/plugin.pb.h
  84. 28 28
      src/google/protobuf/descriptor.pb.h
  85. 2 2
      src/google/protobuf/duration.pb.h
  86. 2 2
      src/google/protobuf/empty.pb.h
  87. 2 2
      src/google/protobuf/field_mask.pb.h
  88. 5 1
      src/google/protobuf/port_def.inc
  89. 1 0
      src/google/protobuf/port_undef.inc
  90. 2 2
      src/google/protobuf/source_context.pb.h
  91. 4 4
      src/google/protobuf/struct.pb.h
  92. 1 5
      src/google/protobuf/stubs/common.h
  93. 0 55
      src/google/protobuf/stubs/mathlimits.cc
  94. 1 1
      src/google/protobuf/stubs/mathlimits.h
  95. 4 2
      src/google/protobuf/stubs/strutil.cc
  96. 1 0
      src/google/protobuf/test_messages_proto3.proto
  97. 3 1
      src/google/protobuf/text_format.cc
  98. 2 2
      src/google/protobuf/timestamp.pb.h
  99. 6 6
      src/google/protobuf/type.pb.h
  100. 10 10
      src/google/protobuf/wrappers.pb.h

+ 19 - 2
BUILD

@@ -69,9 +69,25 @@ config_setting(
     },
     },
 )
 )
 
 
+config_setting(
+    name = "android-libcpp",
+    values = {
+        "crosstool_top": "@androidndk//:toolchain-libcpp",
+    },
+)
+
+config_setting(
+    name = "android-gnu-libstdcpp",
+    values = {
+        "crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp",
+    },
+)
+
 # Android and MSVC builds do not need to link in a separate pthread library.
 # Android and MSVC builds do not need to link in a separate pthread library.
 LINK_OPTS = select({
 LINK_OPTS = select({
     ":android": [],
     ":android": [],
+    ":android-libcpp": [],
+    ":android-gnu-libstdcpp": [],
     ":msvc": [
     ":msvc": [
         # Suppress linker warnings about files with no symbols defined.
         # Suppress linker warnings about files with no symbols defined.
         "-ignore:4221",
         "-ignore:4221",
@@ -92,16 +108,18 @@ cc_library(
     name = "protobuf_lite",
     name = "protobuf_lite",
     srcs = [
     srcs = [
         # AUTOGEN(protobuf_lite_srcs)
         # AUTOGEN(protobuf_lite_srcs)
-		"src/google/protobuf/any_lite.cc",
+        "src/google/protobuf/any_lite.cc",
         "src/google/protobuf/arena.cc",
         "src/google/protobuf/arena.cc",
         "src/google/protobuf/extension_set.cc",
         "src/google/protobuf/extension_set.cc",
         "src/google/protobuf/generated_message_table_driven_lite.cc",
         "src/google/protobuf/generated_message_table_driven_lite.cc",
         "src/google/protobuf/generated_message_util.cc",
         "src/google/protobuf/generated_message_util.cc",
         "src/google/protobuf/implicit_weak_message.cc",
         "src/google/protobuf/implicit_weak_message.cc",
         "src/google/protobuf/io/coded_stream.cc",
         "src/google/protobuf/io/coded_stream.cc",
+        "src/google/protobuf/io/strtod.cc",
         "src/google/protobuf/io/zero_copy_stream.cc",
         "src/google/protobuf/io/zero_copy_stream.cc",
         "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
         "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
         "src/google/protobuf/message_lite.cc",
         "src/google/protobuf/message_lite.cc",
+        "src/google/protobuf/parse_context.cc",
         "src/google/protobuf/repeated_field.cc",
         "src/google/protobuf/repeated_field.cc",
         "src/google/protobuf/stubs/bytestream.cc",
         "src/google/protobuf/stubs/bytestream.cc",
         "src/google/protobuf/stubs/common.cc",
         "src/google/protobuf/stubs/common.cc",
@@ -149,7 +167,6 @@ cc_library(
         "src/google/protobuf/generated_message_table_driven.cc",
         "src/google/protobuf/generated_message_table_driven.cc",
         "src/google/protobuf/io/gzip_stream.cc",
         "src/google/protobuf/io/gzip_stream.cc",
         "src/google/protobuf/io/printer.cc",
         "src/google/protobuf/io/printer.cc",
-        "src/google/protobuf/io/strtod.cc",
         "src/google/protobuf/io/tokenizer.cc",
         "src/google/protobuf/io/tokenizer.cc",
         "src/google/protobuf/io/zero_copy_stream_impl.cc",
         "src/google/protobuf/io/zero_copy_stream_impl.cc",
         "src/google/protobuf/map_field.cc",
         "src/google/protobuf/map_field.cc",

+ 1 - 1
CHANGES.txt

@@ -647,7 +647,7 @@
     details about APIs.
     details about APIs.
 
 
   Objective-C
   Objective-C
-  * Helpers are now provided for working the the Any well known type (see
+  * Helpers are now provided for working the Any well known type (see
     GPBWellKnownTypes.h for the api additions).
     GPBWellKnownTypes.h for the api additions).
   * Some improvements in startup code (especially when extensions aren’t used).
   * Some improvements in startup code (especially when extensions aren’t used).
 
 

+ 1 - 1
Protobuf.podspec

@@ -5,7 +5,7 @@
 # dependent projects use the :git notation to refer to the library.
 # dependent projects use the :git notation to refer to the library.
 Pod::Spec.new do |s|
 Pod::Spec.new do |s|
   s.name     = 'Protobuf'
   s.name     = 'Protobuf'
-  s.version  = '3.7.0'
+  s.version  = '3.7.1'
   s.summary  = 'Protocol Buffers v.3 runtime library for Objective-C.'
   s.summary  = 'Protocol Buffers v.3 runtime library for Objective-C.'
   s.homepage = 'https://github.com/protocolbuffers/protobuf'
   s.homepage = 'https://github.com/protocolbuffers/protobuf'
   s.license  = '3-Clause BSD License'
   s.license  = '3-Clause BSD License'

+ 1 - 1
cmake/extract_includes.bat.in

@@ -89,6 +89,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" includ
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
+copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\io_win32.h" include\google\protobuf\stubs\io_win32.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h
@@ -97,7 +98,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\platform_macros
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\port.h" include\google\protobuf\stubs\port.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\port.h" include\google\protobuf\stubs\port.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\status.h" include\google\protobuf\stubs\status.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\status.h" include\google\protobuf\stubs\status.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stl_util.h" include\google\protobuf\stubs\stl_util.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stl_util.h" include\google\protobuf\stubs\stl_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stringpiece.h" include\google\protobuf\stubs\stringpiece.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stringpiece.h" include\google\protobuf\stubs\stringpiece.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\template_util.h" include\google\protobuf\stubs\template_util.h
 copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\template_util.h" include\google\protobuf\stubs\template_util.h

+ 1 - 1
cmake/libprotobuf-lite.cmake

@@ -5,13 +5,13 @@ set(libprotobuf_lite_files
   ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc
   ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc
   ${protobuf_source_dir}/src/google/protobuf/generated_message_util.cc
   ${protobuf_source_dir}/src/google/protobuf/generated_message_util.cc
   ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.cc
   ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.cc
-  ${protobuf_source_dir}/src/google/protobuf/parse_context.cc
   ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.cc
   ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.cc
   ${protobuf_source_dir}/src/google/protobuf/io/io_win32.cc
   ${protobuf_source_dir}/src/google/protobuf/io/io_win32.cc
   ${protobuf_source_dir}/src/google/protobuf/io/strtod.cc
   ${protobuf_source_dir}/src/google/protobuf/io/strtod.cc
   ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc
   ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc
   ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
   ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
   ${protobuf_source_dir}/src/google/protobuf/message_lite.cc
   ${protobuf_source_dir}/src/google/protobuf/message_lite.cc
+  ${protobuf_source_dir}/src/google/protobuf/parse_context.cc
   ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc
   ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/common.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/common.cc

+ 5 - 3
configure.ac

@@ -17,7 +17,7 @@ AC_PREREQ(2.59)
 # In the SVN trunk, the version should always be the next anticipated release
 # In the SVN trunk, the version should always be the next anticipated release
 # version with the "-pre" suffix.  (We used to use "-SNAPSHOT" but this pushed
 # version with the "-pre" suffix.  (We used to use "-SNAPSHOT" but this pushed
 # the size of one file name in the dist tarfile over the 99-char limit.)
 # the size of one file name in the dist tarfile over the 99-char limit.)
-AC_INIT([Protocol Buffers],[3.7.0],[protobuf@googlegroups.com],[protobuf])
+AC_INIT([Protocol Buffers],[3.7.1],[protobuf@googlegroups.com],[protobuf])
 
 
 AM_MAINTAINER_MODE([enable])
 AM_MAINTAINER_MODE([enable])
 
 
@@ -165,6 +165,10 @@ AS_IF([test "$with_zlib" != no], [
 ])
 ])
 AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
 AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
 
 
+# Add -std=c++11 if necesssary. It is important for us to do this before the
+# libatomic check below, since that also depends on C++11.
+AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
+
 dnl On some platforms, std::atomic needs a helper library
 dnl On some platforms, std::atomic needs a helper library
 AC_MSG_CHECKING(whether -latomic is needed)
 AC_MSG_CHECKING(whether -latomic is needed)
 AC_LINK_IFELSE([AC_LANG_SOURCE([[
 AC_LINK_IFELSE([AC_LANG_SOURCE([[
@@ -214,8 +218,6 @@ case "$target_os" in
 esac
 esac
 AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
 AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
 
 
-AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
-
 # HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
 # HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
 #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
 #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
 #   too.
 #   too.

+ 48 - 0
conformance/binary_json_conformance_suite.cc

@@ -2139,6 +2139,24 @@ void BinaryAndJsonConformanceSuite::RunSuiteImpl() {
           }
           }
         }
         }
       )");
       )");
+  RunValidJsonTest(
+      "StructWithEmptyListValue", REQUIRED,
+      R"({
+        "optionalStruct": {
+          "listValue": []
+        }
+      })",
+      R"(
+        optional_struct: {
+          fields: {
+            key: "listValue"
+            value: {
+              list_value: {
+              }
+            }
+          }
+        }
+      )");
   // Value
   // Value
   RunValidJsonTest(
   RunValidJsonTest(
       "ValueAcceptInteger", REQUIRED,
       "ValueAcceptInteger", REQUIRED,
@@ -2190,6 +2208,36 @@ void BinaryAndJsonConformanceSuite::RunSuiteImpl() {
           }
           }
         }
         }
       )");
       )");
+  RunValidJsonTest(
+      "RepeatedValue", REQUIRED,
+      R"({
+        "repeatedValue": [["a"]]
+      })",
+      R"(
+        repeated_value: [
+          {
+            list_value: {
+              values: [
+                { string_value: "a"}
+              ]
+            }
+          }
+        ]
+      )");
+  RunValidJsonTest(
+      "RepeatedListValue", REQUIRED,
+      R"({
+        "repeatedListValue": [["a"]]
+      })",
+      R"(
+        repeated_list_value: [
+          {
+            values: [
+              { string_value: "a"}
+            ]
+          }
+        ]
+      )");
 
 
   // Any
   // Any
   RunValidJsonTest(
   RunValidJsonTest(

+ 2 - 0
conformance/failure_list_php.txt

@@ -14,6 +14,8 @@ Required.Proto3.JsonInput.DoubleFieldTooSmall
 Required.Proto3.JsonInput.Int32FieldNotInteger
 Required.Proto3.JsonInput.Int32FieldNotInteger
 Required.Proto3.JsonInput.Int64FieldNotInteger
 Required.Proto3.JsonInput.Int64FieldNotInteger
 Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
 Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
+Required.Proto3.JsonInput.RepeatedListValue.JsonOutput
+Required.Proto3.JsonInput.RepeatedListValue.ProtobufOutput
 Required.Proto3.JsonInput.StringFieldNotAString
 Required.Proto3.JsonInput.StringFieldNotAString
 Required.Proto3.JsonInput.Uint32FieldNotInteger
 Required.Proto3.JsonInput.Uint32FieldNotInteger
 Required.Proto3.JsonInput.Uint64FieldNotInteger
 Required.Proto3.JsonInput.Uint64FieldNotInteger

+ 0 - 1
conformance/failure_list_ruby.txt

@@ -65,4 +65,3 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonNumber.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput
-Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput

+ 0 - 1
conformance/failure_list_ruby_mac.txt

@@ -70,4 +70,3 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput
 Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput
 Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
 Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
-Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput

+ 1 - 1
csharp/Google.Protobuf.Tools.nuspec

@@ -5,7 +5,7 @@
     <title>Google Protocol Buffers tools</title>
     <title>Google Protocol Buffers tools</title>
     <summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
     <summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
     <description>See project site for more info.</description>
     <description>See project site for more info.</description>
-    <version>3.7.0</version>
+    <version>3.7.1</version>
     <authors>Google Inc.</authors>
     <authors>Google Inc.</authors>
     <owners>protobuf-packages</owners>
     <owners>protobuf-packages</owners>
     <licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>
     <licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>

File diff suppressed because it is too large
+ 51 - 50
csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs


BIN
csharp/src/Google.Protobuf.Test/testprotos.pb


+ 1 - 1
csharp/src/Google.Protobuf/Google.Protobuf.csproj

@@ -4,7 +4,7 @@
     <Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
     <Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
     <Copyright>Copyright 2015, Google Inc.</Copyright>
     <Copyright>Copyright 2015, Google Inc.</Copyright>
     <AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
     <AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
-    <VersionPrefix>3.7.0</VersionPrefix>
+    <VersionPrefix>3.7.1</VersionPrefix>
     <LangVersion>6</LangVersion>
     <LangVersion>6</LangVersion>
     <Authors>Google Inc.</Authors>
     <Authors>Google Inc.</Authors>
     <TargetFrameworks>netstandard1.0;netstandard2.0;net45</TargetFrameworks>
     <TargetFrameworks>netstandard1.0;netstandard2.0;net45</TargetFrameworks>

+ 1 - 1
docs/third_party.md

@@ -78,7 +78,7 @@ These are projects we know about implementing Protocol Buffers for other program
 * PHP: http://drslump.github.com/Protobuf-PHP
 * PHP: http://drslump.github.com/Protobuf-PHP
 * Prolog: http://www.swi-prolog.org/pldoc/package/protobufs.html
 * Prolog: http://www.swi-prolog.org/pldoc/package/protobufs.html
 * Python: https://github.com/google/protobuf (Google-official implementation)
 * Python: https://github.com/google/protobuf (Google-official implementation)
-* Python: http://eigenein.github.com/protobuf/
+* Python: https://github.com/eigenein/protobuf
 * R: http://cran.r-project.org/package=RProtoBuf
 * R: http://cran.r-project.org/package=RProtoBuf
 * Ruby: http://code.google.com/p/ruby-protobuf/
 * Ruby: http://code.google.com/p/ruby-protobuf/
 * Ruby: http://github.com/mozy/ruby-protocol-buffers
 * Ruby: http://github.com/mozy/ruby-protocol-buffers

+ 1 - 1
java/bom/pom.xml

@@ -4,7 +4,7 @@
 
 
   <groupId>com.google.protobuf</groupId>
   <groupId>com.google.protobuf</groupId>
   <artifactId>protobuf-bom</artifactId>
   <artifactId>protobuf-bom</artifactId>
-  <version>3.7.0</version>
+  <version>3.7.1</version>
   <packaging>pom</packaging>
   <packaging>pom</packaging>
 
 
   <name>Protocol Buffers [BOM]</name>
   <name>Protocol Buffers [BOM]</name>

+ 1 - 1
java/core/pom.xml

@@ -4,7 +4,7 @@
   <parent>
   <parent>
     <groupId>com.google.protobuf</groupId>
     <groupId>com.google.protobuf</groupId>
     <artifactId>protobuf-parent</artifactId>
     <artifactId>protobuf-parent</artifactId>
-    <version>3.7.0</version>
+    <version>3.7.1</version>
   </parent>
   </parent>
 
 
   <artifactId>protobuf-java</artifactId>
   <artifactId>protobuf-java</artifactId>

+ 1 - 1
java/pom.xml

@@ -4,7 +4,7 @@
 
 
   <groupId>com.google.protobuf</groupId>
   <groupId>com.google.protobuf</groupId>
   <artifactId>protobuf-parent</artifactId>
   <artifactId>protobuf-parent</artifactId>
-  <version>3.7.0</version>
+  <version>3.7.1</version>
   <packaging>pom</packaging>
   <packaging>pom</packaging>
 
 
   <name>Protocol Buffers [Parent]</name>
   <name>Protocol Buffers [Parent]</name>

+ 1 - 1
java/util/pom.xml

@@ -4,7 +4,7 @@
   <parent>
   <parent>
     <groupId>com.google.protobuf</groupId>
     <groupId>com.google.protobuf</groupId>
     <artifactId>protobuf-parent</artifactId>
     <artifactId>protobuf-parent</artifactId>
-    <version>3.7.0</version>
+    <version>3.7.1</version>
   </parent>
   </parent>
 
 
   <artifactId>protobuf-java-util</artifactId>
   <artifactId>protobuf-java-util</artifactId>

+ 1 - 1
js/gulpfile.js

@@ -137,7 +137,7 @@ function getClosureBuilderCommand(exportsFile, outputFile) {
   return './node_modules/google-closure-library/closure/bin/build/closurebuilder.py ' +
   return './node_modules/google-closure-library/closure/bin/build/closurebuilder.py ' +
   '--root node_modules ' +
   '--root node_modules ' +
   '-o compiled ' +
   '-o compiled ' +
-  '--compiler_jar node_modules/google-closure-compiler/compiler.jar ' +
+  '--compiler_jar node_modules/google-closure-compiler-java/compiler.jar ' +
   '-i ' + exportsFile + ' ' +
   '-i ' + exportsFile + ' ' +
   'map.js message.js binary/arith.js binary/constants.js binary/decoder.js ' +
   'map.js message.js binary/arith.js binary/constants.js binary/decoder.js ' +
   'binary/encoder.js binary/reader.js binary/utils.js binary/writer.js ' +
   'binary/encoder.js binary/reader.js binary/utils.js binary/writer.js ' +

+ 3 - 3
js/package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "google-protobuf",
   "name": "google-protobuf",
-  "version": "3.7.0",
+  "version": "3.7.1",
   "description": "Protocol Buffers for JavaScript",
   "description": "Protocol Buffers for JavaScript",
   "main": "google-protobuf.js",
   "main": "google-protobuf.js",
   "files": [
   "files": [
@@ -9,8 +9,8 @@
   "dependencies": {},
   "dependencies": {},
   "devDependencies": {
   "devDependencies": {
     "glob": "~6.0.4",
     "glob": "~6.0.4",
-    "google-closure-compiler": "~20160619.0.0",
-    "google-closure-library": "~20160125.0.0",
+    "google-closure-compiler": "~20190301.0.0",
+    "google-closure-library": "~20190301.0.0",
     "gulp": "~3.9.0",
     "gulp": "~3.9.0",
     "jasmine": "~2.4.1"
     "jasmine": "~2.4.1"
   },
   },

+ 1 - 1
kokoro/linux/dockerfile/push_testing_images.sh

@@ -4,7 +4,7 @@ set -ex
 
 
 cd $(dirname $0)/../../..
 cd $(dirname $0)/../../..
 git_root=$(pwd)
 git_root=$(pwd)
-cd -
+cd kokoro/linux/dockerfile
 
 
 DOCKERHUB_ORGANIZATION=protobuftesting
 DOCKERHUB_ORGANIZATION=protobuftesting
 
 

+ 33 - 0
kokoro/linux/dockerfile/test/javascript/Dockerfile

@@ -0,0 +1,33 @@
+FROM ubuntu:latest
+
+RUN apt-get update && apt-get install -y gnupg
+
+# Install dependencies.  We start with the basic ones require to build protoc
+# and the C++ build
+RUN apt-get clean && apt-get update && apt-get install -y --force-yes \
+  autoconf \
+  autotools-dev \
+  build-essential \
+  bzip2 \
+  ccache \
+  curl \
+  gcc \
+  git \
+  libc6 \
+  libc6-dbg \
+  libc6-dev \
+  libgtest-dev \
+  libtool \
+  make \
+  parallel \
+  time \
+  wget \
+  && apt-get clean
+
+
+##################
+# Javascript dependencies.
+RUN apt-get install -y \
+  # -- For javascript and closure compiler -- \
+  npm \
+  default-jre

+ 2 - 1
kokoro/linux/javascript/build.sh

@@ -10,7 +10,8 @@
 # Change to repo root
 # Change to repo root
 cd $(dirname $0)/../../..
 cd $(dirname $0)/../../..
 
 
-export DOCKERFILE_DIR=kokoro/linux/64-bit
+export DOCKERHUB_ORGANIZATION=protobuftesting
+export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/javascript
 export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
 export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
 export OUTPUT_DIR=testoutput
 export OUTPUT_DIR=testoutput
 export TEST_SET="javascript"
 export TEST_SET="javascript"

+ 1 - 1
kokoro/macos/prepare_build_macos_rc

@@ -23,7 +23,7 @@ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/
 source $HOME/.rvm/scripts/rvm
 source $HOME/.rvm/scripts/rvm
 brew uninstall node icu4c cmake
 brew uninstall node icu4c cmake
 brew prune
 brew prune
-brew install gflags gpg gpg2 node pcre ruby cmake
+brew install gflags gpg gpg2 node openssl pcre ruby cmake
 sudo chown -R $(whoami) /usr/local
 sudo chown -R $(whoami) /usr/local
 brew postinstall node
 brew postinstall node
 
 

+ 2 - 2
objectivec/GPBMessage.h

@@ -308,7 +308,7 @@ CF_EXTERN_C_END
 - (void)writeToOutputStream:(NSOutputStream *)output;
 - (void)writeToOutputStream:(NSOutputStream *)output;
 
 
 /**
 /**
- * Writes out a varint for the message size followed by the the message to
+ * Writes out a varint for the message size followed by the message to
  * the given output stream.
  * the given output stream.
  *
  *
  * @param output The coded output stream into which to write the message.
  * @param output The coded output stream into which to write the message.
@@ -318,7 +318,7 @@ CF_EXTERN_C_END
 - (void)writeDelimitedToCodedOutputStream:(GPBCodedOutputStream *)output;
 - (void)writeDelimitedToCodedOutputStream:(GPBCodedOutputStream *)output;
 
 
 /**
 /**
- * Writes out a varint for the message size followed by the the message to
+ * Writes out a varint for the message size followed by the message to
  * the given output stream.
  * the given output stream.
  *
  *
  * @param output The output stream into which to write the message.
  * @param output The output stream into which to write the message.

+ 2 - 2
php/ext/google/protobuf/def.c

@@ -896,8 +896,8 @@ const upb_filedef *parse_and_add_descriptor(const char *data,
   const upb_filedef* file;
   const upb_filedef* file;
   upb_status status;
   upb_status status;
 
 
-  set = google_protobuf_FileDescriptorSet_parsenew(
-      upb_strview_make(data, data_len), arena);
+  set = google_protobuf_FileDescriptorSet_parse(
+      data, data_len, arena);
 
 
   if (!set) {
   if (!set) {
     zend_error(E_ERROR, "Failed to parse binary descriptor\n");
     zend_error(E_ERROR, "Failed to parse binary descriptor\n");

+ 18 - 4
php/ext/google/protobuf/package.xml

@@ -10,11 +10,11 @@
   <email>protobuf-opensource@google.com</email>
   <email>protobuf-opensource@google.com</email>
   <active>yes</active>
   <active>yes</active>
  </lead>
  </lead>
- <date>2019-02-28</date>
- <time>10:19:15</time>
+ <date>2019-03-25</date>
+ <time>13:23:39</time>
  <version>
  <version>
-  <release>3.7.0</release>
-  <api>3.7.0</api>
+  <release>3.7.1</release>
+  <api>3.7.1</api>
  </version>
  </version>
  <stability>
  <stability>
   <release>stable</release>
   <release>stable</release>
@@ -304,5 +304,19 @@ G  A release.
    <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
    <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
    <notes>GA release.</notes>
    <notes>GA release.</notes>
   </release>
   </release>
+  <release>
+   <version>
+    <release>3.7.1</release>
+    <api>3.7.1</api>
+   </version>
+   <stability>
+    <release>stable</release>
+    <api>stable</api>
+   </stability>
+   <date>2019-03-25</date>
+   <time>13:23:39</time>
+   <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
+   <notes>GA release.</notes>
+  </release>
  </changelog>
  </changelog>
 </package>
 </package>

+ 1 - 1
php/ext/google/protobuf/protobuf.h

@@ -37,7 +37,7 @@
 #include "upb.h"
 #include "upb.h"
 
 
 #define PHP_PROTOBUF_EXTNAME "protobuf"
 #define PHP_PROTOBUF_EXTNAME "protobuf"
-#define PHP_PROTOBUF_VERSION "3.7.0"
+#define PHP_PROTOBUF_VERSION "3.7.1"
 
 
 #define MAX_LENGTH_OF_INT64 20
 #define MAX_LENGTH_OF_INT64 20
 #define SIZEOF_INT64 8
 #define SIZEOF_INT64 8

+ 308 - 230
php/ext/google/protobuf/upb.c

@@ -1,5 +1,4 @@
 /* Amalgamated source file */
 /* Amalgamated source file */
-#define _XOPEN_SOURCE 700
 #include "upb.h"
 #include "upb.h"
 
 
 #ifndef UINTPTR_MAX
 #ifndef UINTPTR_MAX
@@ -1086,11 +1085,12 @@ static bool upb_decode_message(upb_decstate *d, const char *limit,
   return true;
   return true;
 }
 }
 
 
-bool upb_decode(upb_strview buf, void *msg, const upb_msglayout *l) {
+bool upb_decode(const char *buf, size_t size, void *msg,
+                const upb_msglayout *l) {
   upb_decstate state;
   upb_decstate state;
-  state.ptr = buf.data;
+  state.ptr = buf;
 
 
-  return upb_decode_message(&state, buf.data + buf.size, 0, msg, l);
+  return upb_decode_message(&state, buf + size, 0, msg, l);
 }
 }
 
 
 #undef CHK
 #undef CHK
@@ -2836,7 +2836,8 @@ bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init) {
     if (!_upb_symtab_loaddefinit(s, *deps)) goto err;
     if (!_upb_symtab_loaddefinit(s, *deps)) goto err;
   }
   }
 
 
-  file = google_protobuf_FileDescriptorProto_parsenew(init->descriptor, arena);
+  file = google_protobuf_FileDescriptorProto_parse(
+      init->descriptor.data, init->descriptor.size, arena);
 
 
   if (!file) {
   if (!file) {
     upb_status_seterrf(
     upb_status_seterrf(
@@ -5364,7 +5365,7 @@ bool upb_inttable_iter_isequal(const upb_inttable_iter *i1,
          i1->array_part == i2->array_part;
          i1->array_part == i2->array_part;
 }
 }
 
 
-#ifdef UPB_UNALIGNED_READS_OK
+#if defined(UPB_UNALIGNED_READS_OK) || defined(__s390x__)
 /* -----------------------------------------------------------------------------
 /* -----------------------------------------------------------------------------
  * MurmurHash2, by Austin Appleby (released as public domain).
  * MurmurHash2, by Austin Appleby (released as public domain).
  * Reformatted and C99-ified by Joshua Haberman.
  * Reformatted and C99-ified by Joshua Haberman.
@@ -8797,9 +8798,6 @@ done:
 ** - handling of keys/escape-sequences/etc that span input buffers.
 ** - handling of keys/escape-sequences/etc that span input buffers.
 */
 */
 
 
-/* Need to define _XOPEN_SOURCE before any include to make strptime work. */
-#define _XOPEN_SOURCE 700
-
 #include <ctype.h>
 #include <ctype.h>
 #include <errno.h>
 #include <errno.h>
 #include <float.h>
 #include <float.h>
@@ -8960,6 +8958,11 @@ typedef struct {
   /* The table mapping json name to fielddef for this message. */
   /* The table mapping json name to fielddef for this message. */
   const upb_strtable *name_table;
   const upb_strtable *name_table;
 
 
+  /* We are in a repeated-field context. We need this flag to decide whether to
+   * handle the array as a normal repeated field or a
+   * google.protobuf.ListValue/google.protobuf.Value. */
+  bool is_repeated;
+
   /* We are in a repeated-field context, ready to emit mapentries as
   /* We are in a repeated-field context, ready to emit mapentries as
    * submessages. This flag alters the start-of-object (open-brace) behavior to
    * submessages. This flag alters the start-of-object (open-brace) behavior to
    * begin a sequence of mapentry messages rather than a single submessage. */
    * begin a sequence of mapentry messages rather than a single submessage. */
@@ -8990,6 +8993,19 @@ typedef struct {
   bool is_unknown_field;
   bool is_unknown_field;
 } upb_jsonparser_frame;
 } upb_jsonparser_frame;
 
 
+static void init_frame(upb_jsonparser_frame* frame) {
+  frame->m = NULL;
+  frame->f = NULL;
+  frame->name_table = NULL;
+  frame->is_repeated = false;
+  frame->is_map = false;
+  frame->is_mapentry = false;
+  frame->mapfield = NULL;
+  frame->is_any = false;
+  frame->any_frame = NULL;
+  frame->is_unknown_field = false;
+}
+
 struct upb_json_parser {
 struct upb_json_parser {
   upb_arena *arena;
   upb_arena *arena;
   const upb_json_parsermethod *method;
   const upb_json_parsermethod *method;
@@ -9037,6 +9053,13 @@ struct upb_json_parser {
   struct tm tm;
   struct tm tm;
 };
 };
 
 
+static upb_jsonparser_frame* start_jsonparser_frame(upb_json_parser *p) {
+  upb_jsonparser_frame *inner;
+  inner = p->top + 1;
+  init_frame(inner);
+  return inner;
+}
+
 struct upb_json_codecache {
 struct upb_json_codecache {
   upb_arena *arena;
   upb_arena *arena;
   upb_inttable methods;   /* upb_msgdef* -> upb_json_parsermethod* */
   upb_inttable methods;   /* upb_msgdef* -> upb_json_parsermethod* */
@@ -9995,17 +10018,11 @@ static bool start_stringval(upb_json_parser *p) {
 
 
     /* Start a new parser frame: parser frames correspond one-to-one with
     /* Start a new parser frame: parser frames correspond one-to-one with
      * handler frames, and string events occur in a sub-frame. */
      * handler frames, and string events occur in a sub-frame. */
-    inner = p->top + 1;
+    inner = start_jsonparser_frame(p);
     sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
     sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
     upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
     upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
     inner->m = p->top->m;
     inner->m = p->top->m;
     inner->f = p->top->f;
     inner->f = p->top->f;
-    inner->name_table = NULL;
-    inner->is_map = false;
-    inner->is_mapentry = false;
-    inner->is_any = false;
-    inner->any_frame = NULL;
-    inner->is_unknown_field = false;
     p->top = inner;
     p->top = inner;
 
 
     if (upb_fielddef_type(p->top->f) == UPB_TYPE_STRING) {
     if (upb_fielddef_type(p->top->f) == UPB_TYPE_STRING) {
@@ -10288,47 +10305,100 @@ static bool end_duration_base(upb_json_parser *p, const char *ptr) {
   return true;
   return true;
 }
 }
 
 
-static void start_timestamp_base(upb_json_parser *p, const char *ptr) {
+static int parse_timestamp_number(upb_json_parser *p) {
+  size_t len;
+  const char *buf;
+  char *end;
+  int val;
+
+  /* atoi() and friends unfortunately do not support specifying the length of
+   * the input string, so we need to force a copy into a NULL-terminated buffer. */
+  multipart_text(p, "\0", 1, false);
+
+  buf = accumulate_getptr(p, &len);
+  val = atoi(buf);
+  multipart_end(p);
+  multipart_startaccum(p);
+
+  return val;
+}
+
+static void start_year(upb_json_parser *p, const char *ptr) {
   capture_begin(p, ptr);
   capture_begin(p, ptr);
 }
 }
 
 
-#define UPB_TIMESTAMP_BASE_SIZE 19
+static bool end_year(upb_json_parser *p, const char *ptr) {
+  if (!capture_end(p, ptr)) {
+    return false;
+  }
+  p->tm.tm_year = parse_timestamp_number(p) - 1900;
+  return true;
+}
 
 
-static bool end_timestamp_base(upb_json_parser *p, const char *ptr) {
-  size_t len;
-  const char *buf;
-  /* 3 for GMT and 1 for ending 0 */
-  char timestamp_buf[UPB_TIMESTAMP_BASE_SIZE + 4];
+static void start_month(upb_json_parser *p, const char *ptr) {
+  capture_begin(p, ptr);
+}
 
 
+static bool end_month(upb_json_parser *p, const char *ptr) {
   if (!capture_end(p, ptr)) {
   if (!capture_end(p, ptr)) {
     return false;
     return false;
   }
   }
+  p->tm.tm_mon = parse_timestamp_number(p) - 1;
+  return true;
+}
 
 
-  buf = accumulate_getptr(p, &len);
-  UPB_ASSERT(len == UPB_TIMESTAMP_BASE_SIZE);
-  memcpy(timestamp_buf, buf, UPB_TIMESTAMP_BASE_SIZE);
-  memcpy(timestamp_buf + UPB_TIMESTAMP_BASE_SIZE, "GMT", 3);
-  timestamp_buf[UPB_TIMESTAMP_BASE_SIZE + 3] = 0;
+static void start_day(upb_json_parser *p, const char *ptr) {
+  capture_begin(p, ptr);
+}
 
 
-#if defined __MINGW32__ || defined __MINGW64__
-  upb_status_seterrf(p->status,
-                     "error parsing timestamp: mingw doesn't support strptime");
-  return false;
-#else
-  /* Parse seconds */
-  if (strptime(timestamp_buf, "%FT%H:%M:%S%Z", &p->tm) == NULL) {
-    upb_status_seterrf(p->status, "error parsing timestamp: %s", buf);
+static bool end_day(upb_json_parser *p, const char *ptr) {
+  if (!capture_end(p, ptr)) {
     return false;
     return false;
   }
   }
-#endif
+  p->tm.tm_mday = parse_timestamp_number(p);
+  return true;
+}
 
 
-  /* Clean up buffer */
-  multipart_end(p);
-  multipart_startaccum(p);
+static void start_hour(upb_json_parser *p, const char *ptr) {
+  capture_begin(p, ptr);
+}
 
 
+static bool end_hour(upb_json_parser *p, const char *ptr) {
+  if (!capture_end(p, ptr)) {
+    return false;
+  }
+  p->tm.tm_hour = parse_timestamp_number(p);
   return true;
   return true;
 }
 }
 
 
+static void start_minute(upb_json_parser *p, const char *ptr) {
+  capture_begin(p, ptr);
+}
+
+static bool end_minute(upb_json_parser *p, const char *ptr) {
+  if (!capture_end(p, ptr)) {
+    return false;
+  }
+  p->tm.tm_min = parse_timestamp_number(p);
+  return true;
+}
+
+static void start_second(upb_json_parser *p, const char *ptr) {
+  capture_begin(p, ptr);
+}
+
+static bool end_second(upb_json_parser *p, const char *ptr) {
+  if (!capture_end(p, ptr)) {
+    return false;
+  }
+  p->tm.tm_sec = parse_timestamp_number(p);
+  return true;
+}
+
+static void start_timestamp_base(upb_json_parser *p) {
+  memset(&p->tm, 0, sizeof(struct tm));
+}
+
 static void start_timestamp_fraction(upb_json_parser *p, const char *ptr) {
 static void start_timestamp_fraction(upb_json_parser *p, const char *ptr) {
   capture_begin(p, ptr);
   capture_begin(p, ptr);
 }
 }
@@ -10460,17 +10530,11 @@ static bool start_fieldmask_path(upb_json_parser *p) {
 
 
   /* Start a new parser frame: parser frames correspond one-to-one with
   /* Start a new parser frame: parser frames correspond one-to-one with
    * handler frames, and string events occur in a sub-frame. */
    * handler frames, and string events occur in a sub-frame. */
-  inner = p->top + 1;
+  inner = start_jsonparser_frame(p);
   sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
   sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
   upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
   upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
   inner->m = p->top->m;
   inner->m = p->top->m;
   inner->f = p->top->f;
   inner->f = p->top->f;
-  inner->name_table = NULL;
-  inner->is_map = false;
-  inner->is_mapentry = false;
-  inner->is_any = false;
-  inner->any_frame = NULL;
-  inner->is_unknown_field = false;
   p->top = inner;
   p->top = inner;
 
 
   multipart_startaccum(p);
   multipart_startaccum(p);
@@ -10603,17 +10667,12 @@ static bool handle_mapentry(upb_json_parser *p) {
   mapfield = p->top->mapfield;
   mapfield = p->top->mapfield;
   mapentrymsg = upb_fielddef_msgsubdef(mapfield);
   mapentrymsg = upb_fielddef_msgsubdef(mapfield);
 
 
-  inner = p->top + 1;
+  inner = start_jsonparser_frame(p);
   p->top->f = mapfield;
   p->top->f = mapfield;
   sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
   sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
   upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
   upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
   inner->m = mapentrymsg;
   inner->m = mapentrymsg;
-  inner->name_table = NULL;
   inner->mapfield = mapfield;
   inner->mapfield = mapfield;
-  inner->is_map = false;
-  inner->is_any = false;
-  inner->any_frame = NULL;
-  inner->is_unknown_field = false;
 
 
   /* Don't set this to true *yet* -- we reuse parsing handlers below to push
   /* Don't set this to true *yet* -- we reuse parsing handlers below to push
    * the key field value to the sink, and these handlers will pop the frame
    * the key field value to the sink, and these handlers will pop the frame
@@ -10728,15 +10787,7 @@ static bool start_subobject(upb_json_parser *p) {
     upb_jsonparser_frame *inner;
     upb_jsonparser_frame *inner;
     if (!check_stack(p)) return false;
     if (!check_stack(p)) return false;
 
 
-    inner = p->top + 1;
-    inner->m = NULL;
-    inner->f = NULL;
-    inner->is_map = false;
-    inner->is_mapentry = false;
-    inner->is_any = false;
-    inner->any_frame = NULL;
-    inner->is_unknown_field = false;
-    p->top = inner;
+    p->top = start_jsonparser_frame(p);
     return true;
     return true;
   }
   }
 
 
@@ -10748,18 +10799,12 @@ static bool start_subobject(upb_json_parser *p) {
      * context. */
      * context. */
     if (!check_stack(p)) return false;
     if (!check_stack(p)) return false;
 
 
-    inner = p->top + 1;
+    inner = start_jsonparser_frame(p);
     sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
     sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
     upb_sink_startseq(p->top->sink, sel, &inner->sink);
     upb_sink_startseq(p->top->sink, sel, &inner->sink);
     inner->m = upb_fielddef_msgsubdef(p->top->f);
     inner->m = upb_fielddef_msgsubdef(p->top->f);
-    inner->name_table = NULL;
     inner->mapfield = p->top->f;
     inner->mapfield = p->top->f;
-    inner->f = NULL;
     inner->is_map = true;
     inner->is_map = true;
-    inner->is_mapentry = false;
-    inner->is_any = false;
-    inner->any_frame = NULL;
-    inner->is_unknown_field = false;
     p->top = inner;
     p->top = inner;
 
 
     return true;
     return true;
@@ -10771,16 +10816,11 @@ static bool start_subobject(upb_json_parser *p) {
      * context. */
      * context. */
     if (!check_stack(p)) return false;
     if (!check_stack(p)) return false;
 
 
-    inner = p->top + 1;
-
+    inner = start_jsonparser_frame(p);
     sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
     sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
     upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
     upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
     inner->m = upb_fielddef_msgsubdef(p->top->f);
     inner->m = upb_fielddef_msgsubdef(p->top->f);
     set_name_table(p, inner);
     set_name_table(p, inner);
-    inner->f = NULL;
-    inner->is_map = false;
-    inner->is_mapentry = false;
-    inner->is_unknown_field = false;
     p->top = inner;
     p->top = inner;
 
 
     if (is_wellknown_msg(p, UPB_WELLKNOWN_ANY)) {
     if (is_wellknown_msg(p, UPB_WELLKNOWN_ANY)) {
@@ -10877,10 +10917,14 @@ static bool start_array(upb_json_parser *p) {
     } else {
     } else {
       return false;
       return false;
     }
     }
-  } else if (is_wellknown_field(p, UPB_WELLKNOWN_LISTVALUE)) {
+  } else if (is_wellknown_field(p, UPB_WELLKNOWN_LISTVALUE) &&
+             (!upb_fielddef_isseq(p->top->f) ||
+              p->top->is_repeated)) {
     if (!start_subobject(p)) return false;
     if (!start_subobject(p)) return false;
     start_listvalue_object(p);
     start_listvalue_object(p);
-  } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
+  } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE) &&
+             (!upb_fielddef_isseq(p->top->f) ||
+              p->top->is_repeated)) {
     if (!start_subobject(p)) return false;
     if (!start_subobject(p)) return false;
     start_value_object(p, VALUE_LISTVALUE);
     start_value_object(p, VALUE_LISTVALUE);
     if (!start_subobject(p)) return false;
     if (!start_subobject(p)) return false;
@@ -10888,14 +10932,7 @@ static bool start_array(upb_json_parser *p) {
   }
   }
 
 
   if (p->top->is_unknown_field) {
   if (p->top->is_unknown_field) {
-    inner = p->top + 1;
-    inner->m = NULL;
-    inner->name_table = NULL;
-    inner->f = NULL;
-    inner->is_map = false;
-    inner->is_mapentry = false;
-    inner->is_any = false;
-    inner->any_frame = NULL;
+    inner = start_jsonparser_frame(p);
     inner->is_unknown_field = true;
     inner->is_unknown_field = true;
     p->top = inner;
     p->top = inner;
 
 
@@ -10911,17 +10948,12 @@ static bool start_array(upb_json_parser *p) {
 
 
   if (!check_stack(p)) return false;
   if (!check_stack(p)) return false;
 
 
-  inner = p->top + 1;
+  inner = start_jsonparser_frame(p);
   sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
   sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
   upb_sink_startseq(p->top->sink, sel, &inner->sink);
   upb_sink_startseq(p->top->sink, sel, &inner->sink);
   inner->m = p->top->m;
   inner->m = p->top->m;
-  inner->name_table = NULL;
   inner->f = p->top->f;
   inner->f = p->top->f;
-  inner->is_map = false;
-  inner->is_mapentry = false;
-  inner->is_any = false;
-  inner->any_frame = NULL;
-  inner->is_unknown_field = false;
+  inner->is_repeated = true;
   p->top = inner;
   p->top = inner;
 
 
   return true;
   return true;
@@ -11287,27 +11319,30 @@ static bool does_fieldmask_end(upb_json_parser *p) {
  * final state once, when the closing '"' is seen. */
  * final state once, when the closing '"' is seen. */
 
 
 
 
-#line 2695 "upb/json/parser.rl"
+#line 2749 "upb/json/parser.rl"
 
 
 
 
 
 
-#line 2521 "upb/json/parser.c"
+#line 2552 "upb/json/parser.c"
 static const char _json_actions[] = {
 static const char _json_actions[] = {
 	0, 1, 0, 1, 1, 1, 3, 1, 
 	0, 1, 0, 1, 1, 1, 3, 1, 
 	4, 1, 6, 1, 7, 1, 8, 1, 
 	4, 1, 6, 1, 7, 1, 8, 1, 
-	9, 1, 10, 1, 11, 1, 12, 1, 
-	13, 1, 24, 1, 26, 1, 28, 1, 
-	29, 1, 31, 1, 32, 1, 33, 1, 
-	35, 1, 37, 1, 38, 1, 39, 1, 
-	40, 1, 42, 1, 43, 2, 4, 9, 
-	2, 5, 6, 2, 7, 3, 2, 7, 
-	9, 2, 14, 15, 2, 16, 17, 2, 
-	18, 19, 2, 21, 23, 2, 22, 20, 
-	2, 27, 25, 2, 29, 31, 2, 34, 
-	2, 2, 35, 43, 2, 36, 25, 2, 
-	38, 43, 2, 39, 43, 2, 40, 43, 
-	2, 41, 30, 2, 42, 43, 3, 21, 
-	23, 24, 4, 14, 15, 16, 17
+	9, 1, 11, 1, 12, 1, 13, 1, 
+	14, 1, 15, 1, 16, 1, 17, 1, 
+	18, 1, 19, 1, 20, 1, 22, 1, 
+	23, 1, 24, 1, 35, 1, 37, 1, 
+	39, 1, 40, 1, 42, 1, 43, 1, 
+	44, 1, 46, 1, 48, 1, 49, 1, 
+	50, 1, 51, 1, 53, 1, 54, 2, 
+	4, 9, 2, 5, 6, 2, 7, 3, 
+	2, 7, 9, 2, 21, 26, 2, 25, 
+	10, 2, 27, 28, 2, 29, 30, 2, 
+	32, 34, 2, 33, 31, 2, 38, 36, 
+	2, 40, 42, 2, 45, 2, 2, 46, 
+	54, 2, 47, 36, 2, 49, 54, 2, 
+	50, 54, 2, 51, 54, 2, 52, 41, 
+	2, 53, 54, 3, 32, 34, 35, 4, 
+	21, 26, 27, 28
 };
 };
 
 
 static const short _json_key_offsets[] = {
 static const short _json_key_offsets[] = {
@@ -11491,30 +11526,30 @@ static const char _json_trans_targs[] = {
 	106
 	106
 };
 };
 
 
-static const char _json_trans_actions[] = {
-	0, 0, 92, 86, 35, 0, 0, 0, 
-	104, 41, 27, 0, 37, 0, 0, 0, 
+static const unsigned char _json_trans_actions[] = {
+	0, 0, 113, 107, 53, 0, 0, 0, 
+	125, 59, 45, 0, 55, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
-	0, 0, 80, 33, 29, 0, 0, 27, 
-	31, 31, 83, 0, 0, 0, 0, 0, 
+	0, 0, 101, 51, 47, 0, 0, 45, 
+	49, 49, 104, 0, 0, 0, 0, 0, 
 	3, 0, 0, 0, 0, 0, 5, 15, 
 	3, 0, 0, 0, 0, 0, 5, 15, 
-	0, 0, 53, 7, 13, 0, 56, 9, 
-	9, 9, 59, 62, 11, 17, 17, 17, 
-	0, 0, 0, 19, 0, 21, 23, 0, 
-	0, 0, 0, 0, 0, 0, 0, 0, 
-	0, 0, 0, 0, 0, 0, 0, 0, 
-	0, 114, 65, 114, 0, 0, 0, 0, 
-	0, 71, 0, 68, 68, 77, 25, 0, 
-	110, 74, 92, 86, 35, 0, 0, 0, 
-	104, 41, 51, 89, 27, 0, 37, 0, 
-	0, 0, 0, 0, 0, 98, 0, 0, 
-	0, 101, 0, 0, 0, 95, 0, 80, 
-	33, 29, 0, 0, 27, 31, 31, 83, 
-	0, 0, 107, 0, 39, 45, 47, 43, 
-	49
+	0, 0, 71, 7, 13, 0, 74, 9, 
+	9, 9, 77, 80, 11, 37, 37, 37, 
+	0, 0, 0, 39, 0, 41, 86, 0, 
+	0, 0, 17, 19, 0, 21, 23, 0, 
+	25, 27, 0, 29, 31, 0, 33, 35, 
+	0, 135, 83, 135, 0, 0, 0, 0, 
+	0, 92, 0, 89, 89, 98, 43, 0, 
+	131, 95, 113, 107, 53, 0, 0, 0, 
+	125, 59, 69, 110, 45, 0, 55, 0, 
+	0, 0, 0, 0, 0, 119, 0, 0, 
+	0, 122, 0, 0, 0, 116, 0, 101, 
+	51, 47, 0, 0, 45, 49, 49, 104, 
+	0, 0, 128, 0, 57, 63, 65, 61, 
+	67
 };
 };
 
 
-static const char _json_eof_actions[] = {
+static const unsigned char _json_eof_actions[] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
@@ -11528,7 +11563,7 @@ static const char _json_eof_actions[] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0, 
-	0, 0, 0, 39, 45, 47, 43, 49, 
+	0, 0, 0, 57, 63, 65, 61, 67, 
 	0, 0, 0, 0, 0, 0
 	0, 0, 0, 0, 0, 0
 };
 };
 
 
@@ -11543,7 +11578,7 @@ static const int json_en_value_machine = 78;
 static const int json_en_main = 1;
 static const int json_en_main = 1;
 
 
 
 
-#line 2698 "upb/json/parser.rl"
+#line 2752 "upb/json/parser.rl"
 
 
 size_t parse(void *closure, const void *hd, const char *buf, size_t size,
 size_t parse(void *closure, const void *hd, const char *buf, size_t size,
              const upb_bufhandle *handle) {
              const upb_bufhandle *handle) {
@@ -11566,7 +11601,7 @@ size_t parse(void *closure, const void *hd, const char *buf, size_t size,
   capture_resume(parser, buf);
   capture_resume(parser, buf);
 
 
   
   
-#line 2796 "upb/json/parser.c"
+#line 2830 "upb/json/parser.c"
 	{
 	{
 	int _klen;
 	int _klen;
 	unsigned int _trans;
 	unsigned int _trans;
@@ -11641,103 +11676,147 @@ _match:
 		switch ( *_acts++ )
 		switch ( *_acts++ )
 		{
 		{
 	case 1:
 	case 1:
-#line 2526 "upb/json/parser.rl"
+#line 2557 "upb/json/parser.rl"
 	{ p--; {cs = stack[--top]; goto _again;} }
 	{ p--; {cs = stack[--top]; goto _again;} }
 	break;
 	break;
 	case 2:
 	case 2:
-#line 2528 "upb/json/parser.rl"
+#line 2559 "upb/json/parser.rl"
 	{ p--; {stack[top++] = cs; cs = 23;goto _again;} }
 	{ p--; {stack[top++] = cs; cs = 23;goto _again;} }
 	break;
 	break;
 	case 3:
 	case 3:
-#line 2532 "upb/json/parser.rl"
+#line 2563 "upb/json/parser.rl"
 	{ start_text(parser, p); }
 	{ start_text(parser, p); }
 	break;
 	break;
 	case 4:
 	case 4:
-#line 2533 "upb/json/parser.rl"
+#line 2564 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_text(parser, p)); }
 	{ CHECK_RETURN_TOP(end_text(parser, p)); }
 	break;
 	break;
 	case 5:
 	case 5:
-#line 2539 "upb/json/parser.rl"
+#line 2570 "upb/json/parser.rl"
 	{ start_hex(parser); }
 	{ start_hex(parser); }
 	break;
 	break;
 	case 6:
 	case 6:
-#line 2540 "upb/json/parser.rl"
+#line 2571 "upb/json/parser.rl"
 	{ hexdigit(parser, p); }
 	{ hexdigit(parser, p); }
 	break;
 	break;
 	case 7:
 	case 7:
-#line 2541 "upb/json/parser.rl"
+#line 2572 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_hex(parser)); }
 	{ CHECK_RETURN_TOP(end_hex(parser)); }
 	break;
 	break;
 	case 8:
 	case 8:
-#line 2547 "upb/json/parser.rl"
+#line 2578 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(escape(parser, p)); }
 	{ CHECK_RETURN_TOP(escape(parser, p)); }
 	break;
 	break;
 	case 9:
 	case 9:
-#line 2553 "upb/json/parser.rl"
+#line 2584 "upb/json/parser.rl"
 	{ p--; {cs = stack[--top]; goto _again;} }
 	{ p--; {cs = stack[--top]; goto _again;} }
 	break;
 	break;
 	case 10:
 	case 10:
-#line 2565 "upb/json/parser.rl"
-	{ start_duration_base(parser, p); }
+#line 2589 "upb/json/parser.rl"
+	{ start_year(parser, p); }
 	break;
 	break;
 	case 11:
 	case 11:
-#line 2566 "upb/json/parser.rl"
-	{ CHECK_RETURN_TOP(end_duration_base(parser, p)); }
+#line 2590 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_year(parser, p)); }
 	break;
 	break;
 	case 12:
 	case 12:
-#line 2568 "upb/json/parser.rl"
-	{ p--; {cs = stack[--top]; goto _again;} }
+#line 2594 "upb/json/parser.rl"
+	{ start_month(parser, p); }
 	break;
 	break;
 	case 13:
 	case 13:
-#line 2573 "upb/json/parser.rl"
-	{ start_timestamp_base(parser, p); }
+#line 2595 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_month(parser, p)); }
 	break;
 	break;
 	case 14:
 	case 14:
-#line 2574 "upb/json/parser.rl"
-	{ CHECK_RETURN_TOP(end_timestamp_base(parser, p)); }
+#line 2599 "upb/json/parser.rl"
+	{ start_day(parser, p); }
 	break;
 	break;
 	case 15:
 	case 15:
-#line 2576 "upb/json/parser.rl"
-	{ start_timestamp_fraction(parser, p); }
+#line 2600 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_day(parser, p)); }
 	break;
 	break;
 	case 16:
 	case 16:
-#line 2577 "upb/json/parser.rl"
-	{ CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); }
+#line 2604 "upb/json/parser.rl"
+	{ start_hour(parser, p); }
 	break;
 	break;
 	case 17:
 	case 17:
-#line 2579 "upb/json/parser.rl"
-	{ start_timestamp_zone(parser, p); }
+#line 2605 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_hour(parser, p)); }
 	break;
 	break;
 	case 18:
 	case 18:
-#line 2580 "upb/json/parser.rl"
-	{ CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); }
+#line 2609 "upb/json/parser.rl"
+	{ start_minute(parser, p); }
 	break;
 	break;
 	case 19:
 	case 19:
-#line 2582 "upb/json/parser.rl"
-	{ p--; {cs = stack[--top]; goto _again;} }
+#line 2610 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_minute(parser, p)); }
 	break;
 	break;
 	case 20:
 	case 20:
-#line 2587 "upb/json/parser.rl"
-	{ start_fieldmask_path_text(parser, p); }
+#line 2614 "upb/json/parser.rl"
+	{ start_second(parser, p); }
 	break;
 	break;
 	case 21:
 	case 21:
-#line 2588 "upb/json/parser.rl"
-	{ end_fieldmask_path_text(parser, p); }
+#line 2615 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_second(parser, p)); }
 	break;
 	break;
 	case 22:
 	case 22:
-#line 2593 "upb/json/parser.rl"
-	{ start_fieldmask_path(parser); }
+#line 2620 "upb/json/parser.rl"
+	{ start_duration_base(parser, p); }
 	break;
 	break;
 	case 23:
 	case 23:
-#line 2594 "upb/json/parser.rl"
-	{ end_fieldmask_path(parser); }
+#line 2621 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_duration_base(parser, p)); }
 	break;
 	break;
 	case 24:
 	case 24:
-#line 2600 "upb/json/parser.rl"
+#line 2623 "upb/json/parser.rl"
 	{ p--; {cs = stack[--top]; goto _again;} }
 	{ p--; {cs = stack[--top]; goto _again;} }
 	break;
 	break;
 	case 25:
 	case 25:
-#line 2605 "upb/json/parser.rl"
+#line 2628 "upb/json/parser.rl"
+	{ start_timestamp_base(parser); }
+	break;
+	case 26:
+#line 2630 "upb/json/parser.rl"
+	{ start_timestamp_fraction(parser, p); }
+	break;
+	case 27:
+#line 2631 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); }
+	break;
+	case 28:
+#line 2633 "upb/json/parser.rl"
+	{ start_timestamp_zone(parser, p); }
+	break;
+	case 29:
+#line 2634 "upb/json/parser.rl"
+	{ CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); }
+	break;
+	case 30:
+#line 2636 "upb/json/parser.rl"
+	{ p--; {cs = stack[--top]; goto _again;} }
+	break;
+	case 31:
+#line 2641 "upb/json/parser.rl"
+	{ start_fieldmask_path_text(parser, p); }
+	break;
+	case 32:
+#line 2642 "upb/json/parser.rl"
+	{ end_fieldmask_path_text(parser, p); }
+	break;
+	case 33:
+#line 2647 "upb/json/parser.rl"
+	{ start_fieldmask_path(parser); }
+	break;
+	case 34:
+#line 2648 "upb/json/parser.rl"
+	{ end_fieldmask_path(parser); }
+	break;
+	case 35:
+#line 2654 "upb/json/parser.rl"
+	{ p--; {cs = stack[--top]; goto _again;} }
+	break;
+	case 36:
+#line 2659 "upb/json/parser.rl"
 	{
 	{
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) {
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) {
           {stack[top++] = cs; cs = 47;goto _again;}
           {stack[top++] = cs; cs = 47;goto _again;}
@@ -11750,12 +11829,12 @@ _match:
         }
         }
       }
       }
 	break;
 	break;
-	case 26:
-#line 2618 "upb/json/parser.rl"
+	case 37:
+#line 2672 "upb/json/parser.rl"
 	{ p--; {stack[top++] = cs; cs = 78;goto _again;} }
 	{ p--; {stack[top++] = cs; cs = 78;goto _again;} }
 	break;
 	break;
-	case 27:
-#line 2623 "upb/json/parser.rl"
+	case 38:
+#line 2677 "upb/json/parser.rl"
 	{
 	{
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
           start_any_member(parser, p);
           start_any_member(parser, p);
@@ -11764,12 +11843,12 @@ _match:
         }
         }
       }
       }
 	break;
 	break;
-	case 28:
-#line 2630 "upb/json/parser.rl"
+	case 39:
+#line 2684 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_membername(parser)); }
 	{ CHECK_RETURN_TOP(end_membername(parser)); }
 	break;
 	break;
-	case 29:
-#line 2633 "upb/json/parser.rl"
+	case 40:
+#line 2687 "upb/json/parser.rl"
 	{
 	{
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
           end_any_member(parser, p);
           end_any_member(parser, p);
@@ -11778,8 +11857,8 @@ _match:
         }
         }
       }
       }
 	break;
 	break;
-	case 30:
-#line 2644 "upb/json/parser.rl"
+	case 41:
+#line 2698 "upb/json/parser.rl"
 	{
 	{
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
           start_any_object(parser, p);
           start_any_object(parser, p);
@@ -11788,8 +11867,8 @@ _match:
         }
         }
       }
       }
 	break;
 	break;
-	case 31:
-#line 2653 "upb/json/parser.rl"
+	case 42:
+#line 2707 "upb/json/parser.rl"
 	{
 	{
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
         if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
           CHECK_RETURN_TOP(end_any_object(parser, p));
           CHECK_RETURN_TOP(end_any_object(parser, p));
@@ -11798,55 +11877,55 @@ _match:
         }
         }
       }
       }
 	break;
 	break;
-	case 32:
-#line 2665 "upb/json/parser.rl"
+	case 43:
+#line 2719 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(start_array(parser)); }
 	{ CHECK_RETURN_TOP(start_array(parser)); }
 	break;
 	break;
-	case 33:
-#line 2669 "upb/json/parser.rl"
+	case 44:
+#line 2723 "upb/json/parser.rl"
 	{ end_array(parser); }
 	{ end_array(parser); }
 	break;
 	break;
-	case 34:
-#line 2674 "upb/json/parser.rl"
+	case 45:
+#line 2728 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(start_number(parser, p)); }
 	{ CHECK_RETURN_TOP(start_number(parser, p)); }
 	break;
 	break;
-	case 35:
-#line 2675 "upb/json/parser.rl"
+	case 46:
+#line 2729 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_number(parser, p)); }
 	{ CHECK_RETURN_TOP(end_number(parser, p)); }
 	break;
 	break;
-	case 36:
-#line 2677 "upb/json/parser.rl"
+	case 47:
+#line 2731 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(start_stringval(parser)); }
 	{ CHECK_RETURN_TOP(start_stringval(parser)); }
 	break;
 	break;
-	case 37:
-#line 2678 "upb/json/parser.rl"
+	case 48:
+#line 2732 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_stringval(parser)); }
 	{ CHECK_RETURN_TOP(end_stringval(parser)); }
 	break;
 	break;
-	case 38:
-#line 2680 "upb/json/parser.rl"
+	case 49:
+#line 2734 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_bool(parser, true)); }
 	{ CHECK_RETURN_TOP(end_bool(parser, true)); }
 	break;
 	break;
-	case 39:
-#line 2682 "upb/json/parser.rl"
+	case 50:
+#line 2736 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_bool(parser, false)); }
 	{ CHECK_RETURN_TOP(end_bool(parser, false)); }
 	break;
 	break;
-	case 40:
-#line 2684 "upb/json/parser.rl"
+	case 51:
+#line 2738 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_null(parser)); }
 	{ CHECK_RETURN_TOP(end_null(parser)); }
 	break;
 	break;
-	case 41:
-#line 2686 "upb/json/parser.rl"
+	case 52:
+#line 2740 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(start_subobject_full(parser)); }
 	{ CHECK_RETURN_TOP(start_subobject_full(parser)); }
 	break;
 	break;
-	case 42:
-#line 2687 "upb/json/parser.rl"
+	case 53:
+#line 2741 "upb/json/parser.rl"
 	{ end_subobject_full(parser); }
 	{ end_subobject_full(parser); }
 	break;
 	break;
-	case 43:
-#line 2692 "upb/json/parser.rl"
+	case 54:
+#line 2746 "upb/json/parser.rl"
 	{ p--; {cs = stack[--top]; goto _again;} }
 	{ p--; {cs = stack[--top]; goto _again;} }
 	break;
 	break;
-#line 3076 "upb/json/parser.c"
+#line 3154 "upb/json/parser.c"
 		}
 		}
 	}
 	}
 
 
@@ -11863,32 +11942,32 @@ _again:
 	while ( __nacts-- > 0 ) {
 	while ( __nacts-- > 0 ) {
 		switch ( *__acts++ ) {
 		switch ( *__acts++ ) {
 	case 0:
 	case 0:
-#line 2524 "upb/json/parser.rl"
+#line 2555 "upb/json/parser.rl"
 	{ p--; {cs = stack[--top]; 	if ( p == pe )
 	{ p--; {cs = stack[--top]; 	if ( p == pe )
 		goto _test_eof;
 		goto _test_eof;
 goto _again;} }
 goto _again;} }
 	break;
 	break;
-	case 35:
-#line 2675 "upb/json/parser.rl"
+	case 46:
+#line 2729 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_number(parser, p)); }
 	{ CHECK_RETURN_TOP(end_number(parser, p)); }
 	break;
 	break;
-	case 38:
-#line 2680 "upb/json/parser.rl"
+	case 49:
+#line 2734 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_bool(parser, true)); }
 	{ CHECK_RETURN_TOP(end_bool(parser, true)); }
 	break;
 	break;
-	case 39:
-#line 2682 "upb/json/parser.rl"
+	case 50:
+#line 2736 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_bool(parser, false)); }
 	{ CHECK_RETURN_TOP(end_bool(parser, false)); }
 	break;
 	break;
-	case 40:
-#line 2684 "upb/json/parser.rl"
+	case 51:
+#line 2738 "upb/json/parser.rl"
 	{ CHECK_RETURN_TOP(end_null(parser)); }
 	{ CHECK_RETURN_TOP(end_null(parser)); }
 	break;
 	break;
-	case 42:
-#line 2687 "upb/json/parser.rl"
+	case 53:
+#line 2741 "upb/json/parser.rl"
 	{ end_subobject_full(parser); }
 	{ end_subobject_full(parser); }
 	break;
 	break;
-#line 3118 "upb/json/parser.c"
+#line 3196 "upb/json/parser.c"
 		}
 		}
 	}
 	}
 	}
 	}
@@ -11896,7 +11975,7 @@ goto _again;} }
 	_out: {}
 	_out: {}
 	}
 	}
 
 
-#line 2720 "upb/json/parser.rl"
+#line 2774 "upb/json/parser.rl"
 
 
   if (p != pe) {
   if (p != pe) {
     upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p);
     upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p);
@@ -11935,22 +12014,17 @@ static void json_parser_reset(upb_json_parser *p) {
   int top;
   int top;
 
 
   p->top = p->stack;
   p->top = p->stack;
-  p->top->f = NULL;
-  p->top->is_map = false;
-  p->top->is_mapentry = false;
-  p->top->is_any = false;
-  p->top->any_frame = NULL;
-  p->top->is_unknown_field = false;
+  init_frame(p->top);
 
 
   /* Emit Ragel initialization of the parser. */
   /* Emit Ragel initialization of the parser. */
   
   
-#line 3174 "upb/json/parser.c"
+#line 3247 "upb/json/parser.c"
 	{
 	{
 	cs = json_start;
 	cs = json_start;
 	top = 0;
 	top = 0;
 	}
 	}
 
 
-#line 2767 "upb/json/parser.rl"
+#line 2816 "upb/json/parser.rl"
   p->current_state = cs;
   p->current_state = cs;
   p->parser_top = top;
   p->parser_top = top;
   accumulate_clear(p);
   accumulate_clear(p);
@@ -12559,9 +12633,14 @@ static size_t putbytes(void *closure, const void *handler_data, const char *str,
   UPB_UNUSED(handler_data);
   UPB_UNUSED(handler_data);
   UPB_UNUSED(handle);
   UPB_UNUSED(handle);
 
 
+  print_data(p, "\"", 1);
+
   while (remaining > 2) {
   while (remaining > 2) {
-    /* TODO(haberman): handle encoded lengths > sizeof(data) */
-    UPB_ASSERT((limit - to) >= 4);
+    if (limit - to < 4) {
+      bytes = to - data;
+      putstring(p, data, bytes);
+      to = data;
+    }
 
 
     to[0] = base64[from[0] >> 2];
     to[0] = base64[from[0] >> 2];
     to[1] = base64[((from[0] & 0x3) << 4) | (from[1] >> 4)];
     to[1] = base64[((from[0] & 0x3) << 4) | (from[1] >> 4)];
@@ -12593,7 +12672,6 @@ static size_t putbytes(void *closure, const void *handler_data, const char *str,
   }
   }
 
 
   bytes = to - data;
   bytes = to - data;
-  print_data(p, "\"", 1);
   putstring(p, data, bytes);
   putstring(p, data, bytes);
   print_data(p, "\"", 1);
   print_data(p, "\"", 1);
   return len;
   return len;

+ 117 - 73
php/ext/google/protobuf/upb.h

@@ -869,7 +869,8 @@ UPB_INLINE bool _upb_has_oneof_field(const void *msg, size_t case_ofs, int32_t n
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-bool upb_decode(upb_strview buf, upb_msg *msg, const upb_msglayout *l);
+bool upb_decode(const char *buf, size_t size, upb_msg *msg,
+                const upb_msglayout *l);
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }  /* extern "C" */
 }  /* extern "C" */
@@ -1035,14 +1036,16 @@ typedef enum {
   google_protobuf_MethodOptions_IDEMPOTENT = 2
   google_protobuf_MethodOptions_IDEMPOTENT = 2
 } google_protobuf_MethodOptions_IdempotencyLevel;
 } google_protobuf_MethodOptions_IdempotencyLevel;
 
 
+
 /* google.protobuf.FileDescriptorSet */
 /* google.protobuf.FileDescriptorSet */
 
 
 UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_new(upb_arena *arena) {
   return (google_protobuf_FileDescriptorSet *)upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
   return (google_protobuf_FileDescriptorSet *)upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
   google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_FileDescriptorSet_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
@@ -1070,9 +1073,10 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
 UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_FileDescriptorProto *)upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
   return (google_protobuf_FileDescriptorProto *)upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
   google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_FileDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_FileDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_FileDescriptorProto_msginit, arena, len);
@@ -1223,9 +1227,10 @@ UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_F
 UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_DescriptorProto *)upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
   return (google_protobuf_DescriptorProto *)upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
   google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_DescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_DescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_DescriptorProto_msginit, arena, len);
@@ -1369,9 +1374,10 @@ UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobu
 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena *arena) {
   return (google_protobuf_DescriptorProto_ExtensionRange *)upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
   return (google_protobuf_DescriptorProto_ExtensionRange *)upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
   google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
@@ -1412,9 +1418,10 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_Descrip
 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_new(upb_arena *arena) {
   return (google_protobuf_DescriptorProto_ReservedRange *)upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
   return (google_protobuf_DescriptorProto_ReservedRange *)upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
   google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
@@ -1440,9 +1447,10 @@ UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_pro
 UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_new(upb_arena *arena) {
   return (google_protobuf_ExtensionRangeOptions *)upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
   return (google_protobuf_ExtensionRangeOptions *)upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
   google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_ExtensionRangeOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
@@ -1470,9 +1478,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
 UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_FieldDescriptorProto *)upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
   return (google_protobuf_FieldDescriptorProto *)upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
   google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_FieldDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
@@ -1485,9 +1494,9 @@ UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const googl
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 3); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 3); }
 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(24, 24)); }
 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(24, 24)); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 1); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 1); }
-UPB_INLINE google_protobuf_FieldDescriptorProto_Label google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, google_protobuf_FieldDescriptorProto_Label, UPB_SIZE(8, 8)); }
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 2); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 2); }
-UPB_INLINE google_protobuf_FieldDescriptorProto_Type google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, google_protobuf_FieldDescriptorProto_Type, UPB_SIZE(16, 16)); }
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 7); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 7); }
 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(48, 64)); }
 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(48, 64)); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 8); }
 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 8); }
@@ -1511,13 +1520,13 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_
   _upb_sethas(msg, 3);
   _upb_sethas(msg, 3);
   UPB_FIELD_AT(msg, int32_t, UPB_SIZE(24, 24)) = value;
   UPB_FIELD_AT(msg, int32_t, UPB_SIZE(24, 24)) = value;
 }
 }
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldDescriptorProto_Label value) {
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
   _upb_sethas(msg, 1);
   _upb_sethas(msg, 1);
-  UPB_FIELD_AT(msg, google_protobuf_FieldDescriptorProto_Label, UPB_SIZE(8, 8)) = value;
+  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
 }
 }
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldDescriptorProto_Type value) {
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
   _upb_sethas(msg, 2);
   _upb_sethas(msg, 2);
-  UPB_FIELD_AT(msg, google_protobuf_FieldDescriptorProto_Type, UPB_SIZE(16, 16)) = value;
+  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)) = value;
 }
 }
 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
   _upb_sethas(msg, 7);
   _upb_sethas(msg, 7);
@@ -1555,9 +1564,10 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protob
 UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_OneofDescriptorProto *)upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
   return (google_protobuf_OneofDescriptorProto *)upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
   google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_OneofDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
@@ -1592,9 +1602,10 @@ UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorP
 UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_EnumDescriptorProto *)upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
   return (google_protobuf_EnumDescriptorProto *)upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
   google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_EnumDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
@@ -1668,9 +1679,10 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_pro
 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena *arena) {
   return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
   return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
   google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
@@ -1696,9 +1708,10 @@ UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(go
 UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_EnumValueDescriptorProto *)upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
   return (google_protobuf_EnumValueDescriptorProto *)upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
   google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_EnumValueDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
@@ -1739,9 +1752,10 @@ UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDes
 UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_ServiceDescriptorProto *)upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
   return (google_protobuf_ServiceDescriptorProto *)upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
   google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_ServiceDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
@@ -1790,9 +1804,10 @@ UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescrip
 UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_new(upb_arena *arena) {
   return (google_protobuf_MethodDescriptorProto *)upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
   return (google_protobuf_MethodDescriptorProto *)upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
   google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_MethodDescriptorProto_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
@@ -1851,9 +1866,10 @@ UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(googl
 UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_arena *arena) {
   return (google_protobuf_FileOptions *)upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
   return (google_protobuf_FileOptions *)upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
   google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_FileOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
@@ -1864,7 +1880,7 @@ UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_pro
 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 12); }
 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 12); }
 UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(36, 48)); }
 UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(36, 48)); }
 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 1); }
 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 1); }
-UPB_INLINE google_protobuf_FileOptions_OptimizeMode google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, google_protobuf_FileOptions_OptimizeMode, UPB_SIZE(8, 8)); }
+UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 2); }
 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 2); }
 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)); }
 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)); }
 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 13); }
 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 13); }
@@ -1905,9 +1921,9 @@ UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_prot
   _upb_sethas(msg, 12);
   _upb_sethas(msg, 12);
   UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(36, 48)) = value;
   UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(36, 48)) = value;
 }
 }
-UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, google_protobuf_FileOptions_OptimizeMode value) {
+UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
   _upb_sethas(msg, 1);
   _upb_sethas(msg, 1);
-  UPB_FIELD_AT(msg, google_protobuf_FileOptions_OptimizeMode, UPB_SIZE(8, 8)) = value;
+  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
 }
 }
 UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
 UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
   _upb_sethas(msg, 2);
   _upb_sethas(msg, 2);
@@ -1989,9 +2005,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
 UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_new(upb_arena *arena) {
   return (google_protobuf_MessageOptions *)upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
   return (google_protobuf_MessageOptions *)upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
   google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_MessageOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_MessageOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_MessageOptions_msginit, arena, len);
@@ -2043,16 +2060,17 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
 UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_new(upb_arena *arena) {
   return (google_protobuf_FieldOptions *)upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
   return (google_protobuf_FieldOptions *)upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
   google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_FieldOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_FieldOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_FieldOptions_msginit, arena, len);
 }
 }
 
 
 UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 1); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 1); }
-UPB_INLINE google_protobuf_FieldOptions_CType google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, google_protobuf_FieldOptions_CType, UPB_SIZE(8, 8)); }
+UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 3); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 3); }
 UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(24, 24)); }
 UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(24, 24)); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 4); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 4); }
@@ -2060,14 +2078,14 @@ UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_Fi
 UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 5); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 5); }
 UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)); }
 UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 2); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 2); }
-UPB_INLINE google_protobuf_FieldOptions_JSType google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, google_protobuf_FieldOptions_JSType, UPB_SIZE(16, 16)); }
+UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 6); }
 UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 6); }
 UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(27, 27)); }
 UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(27, 27)); }
 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
 
 
-UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, google_protobuf_FieldOptions_CType value) {
+UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
   _upb_sethas(msg, 1);
   _upb_sethas(msg, 1);
-  UPB_FIELD_AT(msg, google_protobuf_FieldOptions_CType, UPB_SIZE(8, 8)) = value;
+  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
 }
 }
 UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
 UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
   _upb_sethas(msg, 3);
   _upb_sethas(msg, 3);
@@ -2081,9 +2099,9 @@ UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptio
   _upb_sethas(msg, 5);
   _upb_sethas(msg, 5);
   UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)) = value;
   UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)) = value;
 }
 }
-UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, google_protobuf_FieldOptions_JSType value) {
+UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
   _upb_sethas(msg, 2);
   _upb_sethas(msg, 2);
-  UPB_FIELD_AT(msg, google_protobuf_FieldOptions_JSType, UPB_SIZE(16, 16)) = value;
+  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)) = value;
 }
 }
 UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
 UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
   _upb_sethas(msg, 6);
   _upb_sethas(msg, 6);
@@ -2109,9 +2127,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
 UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_new(upb_arena *arena) {
   return (google_protobuf_OneofOptions *)upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
   return (google_protobuf_OneofOptions *)upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
   google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_OneofOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
@@ -2139,9 +2158,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
 UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_new(upb_arena *arena) {
   return (google_protobuf_EnumOptions *)upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
   return (google_protobuf_EnumOptions *)upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
   google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_EnumOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_EnumOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_EnumOptions_msginit, arena, len);
@@ -2181,9 +2201,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
 UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_new(upb_arena *arena) {
   return (google_protobuf_EnumValueOptions *)upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
   return (google_protobuf_EnumValueOptions *)upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
   google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_EnumValueOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_EnumValueOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_EnumValueOptions_msginit, arena, len);
@@ -2217,9 +2238,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
 UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_new(upb_arena *arena) {
   return (google_protobuf_ServiceOptions *)upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
   return (google_protobuf_ServiceOptions *)upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
   google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_ServiceOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_ServiceOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_ServiceOptions_msginit, arena, len);
@@ -2253,9 +2275,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
 UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_new(upb_arena *arena) {
   return (google_protobuf_MethodOptions *)upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
   return (google_protobuf_MethodOptions *)upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
   google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_MethodOptions_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
@@ -2264,16 +2287,16 @@ UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_M
 UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_has_field(msg, 2); }
 UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_has_field(msg, 2); }
 UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)); }
 UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)); }
 UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_has_field(msg, 1); }
 UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_has_field(msg, 1); }
-UPB_INLINE google_protobuf_MethodOptions_IdempotencyLevel google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return UPB_FIELD_AT(msg, google_protobuf_MethodOptions_IdempotencyLevel, UPB_SIZE(8, 8)); }
+UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
 
 
 UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
 UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
   _upb_sethas(msg, 2);
   _upb_sethas(msg, 2);
   UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)) = value;
   UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)) = value;
 }
 }
-UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, google_protobuf_MethodOptions_IdempotencyLevel value) {
+UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
   _upb_sethas(msg, 1);
   _upb_sethas(msg, 1);
-  UPB_FIELD_AT(msg, google_protobuf_MethodOptions_IdempotencyLevel, UPB_SIZE(8, 8)) = value;
+  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
 }
 }
 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) {
 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) {
   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
@@ -2295,9 +2318,10 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
 UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_new(upb_arena *arena) {
   return (google_protobuf_UninterpretedOption *)upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
   return (google_protobuf_UninterpretedOption *)upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
   google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_UninterpretedOption_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_UninterpretedOption_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_UninterpretedOption_msginit, arena, len);
@@ -2361,9 +2385,10 @@ UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_p
 UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_new(upb_arena *arena) {
   return (google_protobuf_UninterpretedOption_NamePart *)upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
   return (google_protobuf_UninterpretedOption_NamePart *)upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
   google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_UninterpretedOption_NamePart_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, len);
@@ -2389,9 +2414,10 @@ UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(go
 UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_new(upb_arena *arena) {
   return (google_protobuf_SourceCodeInfo *)upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
   return (google_protobuf_SourceCodeInfo *)upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
   google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_SourceCodeInfo_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_SourceCodeInfo_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_SourceCodeInfo_msginit, arena, len);
@@ -2419,9 +2445,10 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
 UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_new(upb_arena *arena) {
   return (google_protobuf_SourceCodeInfo_Location *)upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
   return (google_protobuf_SourceCodeInfo_Location *)upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
   google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_SourceCodeInfo_Location_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, arena, len);
@@ -2480,9 +2507,10 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_com
 UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_new(upb_arena *arena) {
   return (google_protobuf_GeneratedCodeInfo *)upb_msg_new(&google_protobuf_GeneratedCodeInfo_msginit, arena);
   return (google_protobuf_GeneratedCodeInfo *)upb_msg_new(&google_protobuf_GeneratedCodeInfo_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
   google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_GeneratedCodeInfo_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
@@ -2510,9 +2538,10 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_new(upb_arena *arena) {
 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_new(upb_arena *arena) {
   return (google_protobuf_GeneratedCodeInfo_Annotation *)upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
   return (google_protobuf_GeneratedCodeInfo_Annotation *)upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
 }
 }
-UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parsenew(upb_strview buf, upb_arena *arena) {
+UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse(const char *buf, size_t size,
+                        upb_arena *arena) {
   google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
   google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
-  return (ret && upb_decode(buf, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit)) ? ret : NULL;
+  return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit)) ? ret : NULL;
 }
 }
 UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_arena *arena, size_t *len) {
 UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_arena *arena, size_t *len) {
   return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, len);
   return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, len);
@@ -6729,6 +6758,18 @@ extern "C" {
  * descriptor type (upb_descriptortype_t). */
  * descriptor type (upb_descriptortype_t). */
 extern const uint8_t upb_pb_native_wire_types[];
 extern const uint8_t upb_pb_native_wire_types[];
 
 
+UPB_INLINE uint64_t byteswap64(uint64_t val)
+{
+  return ((((val) & 0xff00000000000000ull) >> 56)
+    | (((val) & 0x00ff000000000000ull) >> 40)
+    | (((val) & 0x0000ff0000000000ull) >> 24)
+    | (((val) & 0x000000ff00000000ull) >> 8)
+    | (((val) & 0x00000000ff000000ull) << 8)
+    | (((val) & 0x0000000000ff0000ull) << 24)
+    | (((val) & 0x000000000000ff00ull) << 40)
+    | (((val) & 0x00000000000000ffull) << 56));
+}
+
 /* Zig-zag encoding/decoding **************************************************/
 /* Zig-zag encoding/decoding **************************************************/
 
 
 UPB_INLINE int32_t upb_zzdec_32(uint32_t n) {
 UPB_INLINE int32_t upb_zzdec_32(uint32_t n) {
@@ -6835,6 +6876,9 @@ UPB_INLINE uint64_t upb_vencode32(uint32_t val) {
   uint64_t ret = 0;
   uint64_t ret = 0;
   UPB_ASSERT(bytes <= 5);
   UPB_ASSERT(bytes <= 5);
   memcpy(&ret, buf, bytes);
   memcpy(&ret, buf, bytes);
+#ifdef UPB_BIG_ENDIAN
+  ret = byteswap64(ret);
+#endif
   UPB_ASSERT(ret <= 0xffffffffffU);
   UPB_ASSERT(ret <= 0xffffffffffU);
   return ret;
   return ret;
 }
 }

+ 0 - 1
php/src/Google/Protobuf/Internal/DescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a message type.
  * Describes a message type.

+ 0 - 1
php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.DescriptorProto.ExtensionRange</code>
  * Generated from protobuf message <code>google.protobuf.DescriptorProto.ExtensionRange</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Range of reserved tag numbers. Reserved tag numbers may not be used by
  * Range of reserved tag numbers. Reserved tag numbers may not be used by

+ 0 - 1
php/src/Google/Protobuf/Internal/EnumDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes an enum type.
  * Describes an enum type.

+ 0 - 1
php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Range of reserved numeric values. Reserved values may not be used by
  * Range of reserved numeric values. Reserved values may not be used by

+ 0 - 1
php/src/Google/Protobuf/Internal/EnumOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.EnumOptions</code>
  * Generated from protobuf message <code>google.protobuf.EnumOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a value within an enum.
  * Describes a value within an enum.

+ 0 - 1
php/src/Google/Protobuf/Internal/EnumValueOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.EnumValueOptions</code>
  * Generated from protobuf message <code>google.protobuf.EnumValueOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.ExtensionRangeOptions</code>
  * Generated from protobuf message <code>google.protobuf.ExtensionRangeOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/FieldDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a field within a message.
  * Describes a field within a message.

+ 0 - 1
php/src/Google/Protobuf/Internal/FieldOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.FieldOptions</code>
  * Generated from protobuf message <code>google.protobuf.FieldOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/FileDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a complete .proto file.
  * Describes a complete .proto file.

+ 0 - 1
php/src/Google/Protobuf/Internal/FileDescriptorSet.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * The protocol compiler can output a FileDescriptorSet containing the .proto
  * The protocol compiler can output a FileDescriptorSet containing the .proto

+ 0 - 1
php/src/Google/Protobuf/Internal/FileOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.FileOptions</code>
  * Generated from protobuf message <code>google.protobuf.FileOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes the relationship between generated code and its original source
  * Describes the relationship between generated code and its original source

+ 0 - 1
php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.GeneratedCodeInfo.Annotation</code>
  * Generated from protobuf message <code>google.protobuf.GeneratedCodeInfo.Annotation</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/MessageOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.MessageOptions</code>
  * Generated from protobuf message <code>google.protobuf.MessageOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/MethodDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a method of a service.
  * Describes a method of a service.

+ 0 - 1
php/src/Google/Protobuf/Internal/MethodOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.MethodOptions</code>
  * Generated from protobuf message <code>google.protobuf.MethodOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/OneofDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a oneof.
  * Describes a oneof.

+ 0 - 1
php/src/Google/Protobuf/Internal/OneofOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.OneofOptions</code>
  * Generated from protobuf message <code>google.protobuf.OneofOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Describes a service.
  * Describes a service.

+ 0 - 1
php/src/Google/Protobuf/Internal/ServiceOptions.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.ServiceOptions</code>
  * Generated from protobuf message <code>google.protobuf.ServiceOptions</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/SourceCodeInfo.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Encapsulates information about the original source file from which a
  * Encapsulates information about the original source file from which a

+ 0 - 1
php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * Generated from protobuf message <code>google.protobuf.SourceCodeInfo.Location</code>
  * Generated from protobuf message <code>google.protobuf.SourceCodeInfo.Location</code>

+ 0 - 1
php/src/Google/Protobuf/Internal/UninterpretedOption.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * A message representing a option the parser does not recognize. This only
  * A message representing a option the parser does not recognize. This only

+ 0 - 1
php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php

@@ -9,7 +9,6 @@ use Google\Protobuf\Internal\GPBWire;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\RepeatedField;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\InputStream;
 use Google\Protobuf\Internal\GPBUtil;
 use Google\Protobuf\Internal\GPBUtil;
-use Google\Protobuf\Internal\GPBWrapperUtils;
 
 
 /**
 /**
  * The name of the uninterpreted option.  Each string represents a segment in
  * The name of the uninterpreted option.  Each string represents a segment in

+ 17 - 0
php/tests/encode_decode_test.php

@@ -167,6 +167,23 @@ class EncodeDecodeTest extends TestBase
         $this->assertSame("\"YQ==\"", $m->serializeToJsonString());
         $this->assertSame("\"YQ==\"", $m->serializeToJsonString());
     }
     }
 
 
+    public function generateRandomString($length = 10) {
+        $randomString = str_repeat("+", $length);
+        for ($i = 0; $i < $length; $i++) {
+            $randomString[$i] = rand(0, 255);
+        }
+        return $randomString;
+    }
+
+    public function testEncodeTopLevelLongBytesValue()
+    {
+        $m = new BytesValue();
+        $data = $this->generateRandomString(12007);
+        $m->setValue($data);
+        $expected = "\"" . base64_encode($data) . "\"";
+        $this->assertSame(strlen($expected), strlen($m->serializeToJsonString()));
+    }
+
     public function testEncode()
     public function testEncode()
     {
     {
         $from = new TestMessage();
         $from = new TestMessage();

+ 1 - 0
php/tests/proto/test.proto

@@ -1,6 +1,7 @@
 syntax = "proto3";
 syntax = "proto3";
 
 
 import 'google/protobuf/any.proto';
 import 'google/protobuf/any.proto';
+import 'google/protobuf/struct.proto';
 import 'proto/test_include.proto';
 import 'proto/test_include.proto';
 import 'proto/test_no_namespace.proto';
 import 'proto/test_no_namespace.proto';
 import 'proto/test_php_namespace.proto';
 import 'proto/test_php_namespace.proto';

+ 2 - 2
protoc-artifacts/build-protoc.sh

@@ -140,9 +140,9 @@ checkDependencies ()
     host_machine="$(uname -m)";
     host_machine="$(uname -m)";
     dump_cmd='ldd '"$1"
     dump_cmd='ldd '"$1"
     if [[ "$ARCH" == x86_32 ]]; then
     if [[ "$ARCH" == x86_32 ]]; then
-      white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2\|libatomic\.so\.1"
+      white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2"
     elif [[ "$ARCH" == x86_64 ]]; then
     elif [[ "$ARCH" == x86_64 ]]; then
-      white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2\|libatomic\.so\.1"
+      white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2"
     elif [[ "$ARCH" == ppcle_64 ]]; then
     elif [[ "$ARCH" == ppcle_64 ]]; then
       if [[ $host_machine != ppc64le ]];then
       if [[ $host_machine != ppc64le ]];then
         dump_cmd='objdump -p '"$1"' | grep NEEDED'
         dump_cmd='objdump -p '"$1"' | grep NEEDED'

+ 1 - 1
protoc-artifacts/pom.xml

@@ -8,7 +8,7 @@
   </parent>
   </parent>
   <groupId>com.google.protobuf</groupId>
   <groupId>com.google.protobuf</groupId>
   <artifactId>protoc</artifactId>
   <artifactId>protoc</artifactId>
-  <version>3.7.0</version>
+  <version>3.7.1</version>
   <packaging>pom</packaging>
   <packaging>pom</packaging>
   <name>Protobuf Compiler</name>
   <name>Protobuf Compiler</name>
   <description>
   <description>

+ 1 - 1
python/google/protobuf/__init__.py

@@ -30,7 +30,7 @@
 
 
 # Copyright 2007 Google Inc. All Rights Reserved.
 # Copyright 2007 Google Inc. All Rights Reserved.
 
 
-__version__ = '3.7.0'
+__version__ = '3.7.1'
 
 
 if __name__ != '__main__':
 if __name__ != '__main__':
   try:
   try:

+ 1 - 0
ruby/.gitignore

@@ -6,3 +6,4 @@ protobuf-jruby.iml
 target/
 target/
 pkg/
 pkg/
 tmp/
 tmp/
+tests/google/

+ 5 - 0
ruby/Rakefile

@@ -93,6 +93,7 @@ genproto_output << "tests/test_ruby_package.rb"
 genproto_output << "tests/test_ruby_package_proto2.rb"
 genproto_output << "tests/test_ruby_package_proto2.rb"
 genproto_output << "tests/basic_test.rb"
 genproto_output << "tests/basic_test.rb"
 genproto_output << "tests/basic_test_proto2.rb"
 genproto_output << "tests/basic_test_proto2.rb"
+genproto_output << "tests/wrappers.rb"
 file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task|
 file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task|
   sh "../src/protoc --ruby_out=. tests/generated_code.proto"
   sh "../src/protoc --ruby_out=. tests/generated_code.proto"
 end
 end
@@ -125,6 +126,10 @@ file "tests/basic_test_proto2.rb" => "tests/basic_test_proto2.proto" do |file_ta
   sh "../src/protoc -I../src -I. --ruby_out=. tests/basic_test_proto2.proto"
   sh "../src/protoc -I../src -I. --ruby_out=. tests/basic_test_proto2.proto"
 end
 end
 
 
+file "tests/wrappers.rb" => "../src/google/protobuf/wrappers.proto" do |file_task|
+  sh "../src/protoc -I../src -I. --ruby_out=tests ../src/google/protobuf/wrappers.proto"
+end
+
 task :genproto => genproto_output
 task :genproto => genproto_output
 
 
 task :clean do
 task :clean do

+ 36 - 1
ruby/ext/google/protobuf_c/encode_decode.c

@@ -1237,6 +1237,34 @@ static void putjsonany(VALUE msg_rb, const Descriptor* desc,
   upb_sink_endmsg(sink, &status);
   upb_sink_endmsg(sink, &status);
 }
 }
 
 
+static void putjsonlistvalue(
+    VALUE msg_rb, const Descriptor* desc,
+    upb_sink* sink, int depth, bool emit_defaults) {
+  upb_status status;
+  upb_sink subsink;
+  MessageHeader* msg = NULL;
+  const upb_fielddef* f = upb_msgdef_itof(desc->msgdef, 1);
+  uint32_t offset =
+      desc->layout->fields[upb_fielddef_index(f)].offset +
+      sizeof(MessageHeader);
+  VALUE ary;
+
+  TypedData_Get_Struct(msg_rb, MessageHeader, &Message_type, msg);
+
+  upb_sink_startmsg(sink);
+
+  ary = DEREF(msg, offset, VALUE);
+
+  if (ary == Qnil || RepeatedField_size(ary) == 0) {
+    upb_sink_startseq(sink, getsel(f, UPB_HANDLER_STARTSEQ), &subsink);
+    upb_sink_endseq(sink, getsel(f, UPB_HANDLER_ENDSEQ));
+  } else {
+    putary(ary, f, sink, depth, emit_defaults, true);
+  }
+
+  upb_sink_endmsg(sink, &status);
+}
+
 static void putmsg(VALUE msg_rb, const Descriptor* desc,
 static void putmsg(VALUE msg_rb, const Descriptor* desc,
                    upb_sink *sink, int depth, bool emit_defaults,
                    upb_sink *sink, int depth, bool emit_defaults,
                    bool is_json, bool open_msg) {
                    bool is_json, bool open_msg) {
@@ -1244,11 +1272,18 @@ static void putmsg(VALUE msg_rb, const Descriptor* desc,
   upb_msg_field_iter i;
   upb_msg_field_iter i;
   upb_status status;
   upb_status status;
 
 
-  if (is_json && upb_msgdef_wellknowntype(desc->msgdef) == UPB_WELLKNOWN_ANY) {
+  if (is_json &&
+      upb_msgdef_wellknowntype(desc->msgdef) == UPB_WELLKNOWN_ANY) {
     putjsonany(msg_rb, desc, sink, depth, emit_defaults);
     putjsonany(msg_rb, desc, sink, depth, emit_defaults);
     return;
     return;
   }
   }
 
 
+  if (is_json &&
+      upb_msgdef_wellknowntype(desc->msgdef) == UPB_WELLKNOWN_LISTVALUE) {
+    putjsonlistvalue(msg_rb, desc, sink, depth, emit_defaults);
+    return;
+  }
+
   if (open_msg) {
   if (open_msg) {
     upb_sink_startmsg(sink);
     upb_sink_startmsg(sink);
   }
   }

+ 68 - 2
ruby/ext/google/protobuf_c/message.c

@@ -119,9 +119,37 @@ enum {
   METHOD_SETTER = 2,
   METHOD_SETTER = 2,
   METHOD_CLEAR = 3,
   METHOD_CLEAR = 3,
   METHOD_PRESENCE = 4,
   METHOD_PRESENCE = 4,
-  METHOD_ENUM_GETTER = 5
+  METHOD_ENUM_GETTER = 5,
+  METHOD_WRAPPER_GETTER = 6,
+  METHOD_WRAPPER_SETTER = 7
 };
 };
 
 
+// Check if the field is a well known wrapper type
+static bool is_wrapper_type_field(const upb_fielddef* field) {
+  char* field_type_name = rb_class2name(field_type_class(field));
+
+  return strcmp(field_type_name, "Google::Protobuf::DoubleValue") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::FloatValue") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::Int32Value") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::Int64Value") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::UInt32Value") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::UInt64Value") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::BoolValue") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::StringValue") == 0 ||
+         strcmp(field_type_name, "Google::Protobuf::BytesValue") == 0;
+}
+
+// Get a new Ruby wrapper type and set the initial value
+static VALUE ruby_wrapper_type(const upb_fielddef* field, const VALUE* value) {
+  if (is_wrapper_type_field(field) && value != Qnil) {
+    VALUE hash = rb_hash_new();
+    rb_hash_aset(hash, rb_str_new2("value"), value);
+    VALUE args[1] = { hash };
+    return rb_class_new_instance(1, args, field_type_class(field));
+  }
+  return Qnil;
+}
+
 static int extract_method_call(VALUE method_name, MessageHeader* self,
 static int extract_method_call(VALUE method_name, MessageHeader* self,
 			       const upb_fielddef **f, const upb_oneofdef **o) {
 			       const upb_fielddef **f, const upb_oneofdef **o) {
   Check_Type(method_name, T_SYMBOL);
   Check_Type(method_name, T_SYMBOL);
@@ -157,6 +185,34 @@ static int extract_method_call(VALUE method_name, MessageHeader* self,
   bool has_field = upb_msgdef_lookupname(self->descriptor->msgdef, name, name_len,
   bool has_field = upb_msgdef_lookupname(self->descriptor->msgdef, name, name_len,
 			                                   &test_f, &test_o);
 			                                   &test_f, &test_o);
 
 
+  // Look for wrapper type accessor of the form <field_name>_as_value
+  if (!has_field &&
+      (accessor_type == METHOD_GETTER || accessor_type == METHOD_SETTER) &&
+      name_len > 9 && strncmp(name + name_len - 9, "_as_value", 9) == 0) {
+    // Find the field name
+    char wrapper_field_name[name_len - 8];
+    strncpy(wrapper_field_name, name, name_len - 9);
+    wrapper_field_name[name_len - 7] = '\0';
+
+    // Check if field exists and is a wrapper type
+    const upb_oneofdef* test_o_wrapper;
+    const upb_fielddef* test_f_wrapper;
+    if (upb_msgdef_lookupname(self->descriptor->msgdef, wrapper_field_name, name_len - 9,
+			                        &test_f_wrapper, &test_o_wrapper) &&
+        upb_fielddef_type(test_f_wrapper) == UPB_TYPE_MESSAGE &&
+        is_wrapper_type_field(test_f_wrapper)) {
+      // It does exist!
+      has_field = true;
+      if (accessor_type == METHOD_SETTER) {
+        accessor_type = METHOD_WRAPPER_SETTER;
+      } else {
+        accessor_type = METHOD_WRAPPER_GETTER;
+      }
+      test_o = test_o_wrapper;
+      test_f = test_f_wrapper;
+    }
+  }
+
   // Look for enum accessor of the form <enum_name>_const
   // Look for enum accessor of the form <enum_name>_const
   if (!has_field && accessor_type == METHOD_GETTER &&
   if (!has_field && accessor_type == METHOD_GETTER &&
       name_len > 6 && strncmp(name + name_len - 6, "_const", 6) == 0) {
       name_len > 6 && strncmp(name + name_len - 6, "_const", 6) == 0) {
@@ -238,7 +294,7 @@ VALUE Message_method_missing(int argc, VALUE* argv, VALUE _self) {
   int accessor_type = extract_method_call(argv[0], self, &f, &o);
   int accessor_type = extract_method_call(argv[0], self, &f, &o);
   if (accessor_type == METHOD_UNKNOWN || (o == NULL && f == NULL) ) {
   if (accessor_type == METHOD_UNKNOWN || (o == NULL && f == NULL) ) {
     return rb_call_super(argc, argv);
     return rb_call_super(argc, argv);
-  } else if (accessor_type == METHOD_SETTER) {
+  } else if (accessor_type == METHOD_SETTER || accessor_type == METHOD_WRAPPER_SETTER) {
     if (argc != 2) {
     if (argc != 2) {
       rb_raise(rb_eArgError, "Expected 2 arguments, received %d", argc);
       rb_raise(rb_eArgError, "Expected 2 arguments, received %d", argc);
     }
     }
@@ -275,6 +331,16 @@ VALUE Message_method_missing(int argc, VALUE* argv, VALUE _self) {
     return Qnil;
     return Qnil;
   } else if (accessor_type == METHOD_PRESENCE) {
   } else if (accessor_type == METHOD_PRESENCE) {
     return layout_has(self->descriptor->layout, Message_data(self), f);
     return layout_has(self->descriptor->layout, Message_data(self), f);
+  } else if (accessor_type == METHOD_WRAPPER_GETTER) {
+    VALUE value = layout_get(self->descriptor->layout, Message_data(self), f);
+    if (value != Qnil) {
+      value = rb_funcall(value, rb_intern("value"), 0);
+    }
+    return value;
+  } else if (accessor_type == METHOD_WRAPPER_SETTER) {
+    VALUE wrapper = ruby_wrapper_type(f, argv[1]);
+    layout_set(self->descriptor->layout, Message_data(self), f, wrapper);
+    return Qnil;
   } else if (accessor_type == METHOD_ENUM_GETTER) {
   } else if (accessor_type == METHOD_ENUM_GETTER) {
     VALUE enum_type = field_type_class(f);
     VALUE enum_type = field_type_class(f);
     VALUE method = rb_intern("const_get");
     VALUE method = rb_intern("const_get");

+ 33 - 3
ruby/ext/google/protobuf_c/storage.c

@@ -178,9 +178,39 @@ void native_slot_set_value_and_case(const char* name,
       if (CLASS_OF(value) == CLASS_OF(Qnil)) {
       if (CLASS_OF(value) == CLASS_OF(Qnil)) {
         value = Qnil;
         value = Qnil;
       } else if (CLASS_OF(value) != type_class) {
       } else if (CLASS_OF(value) != type_class) {
-        rb_raise(cTypeError,
-                 "Invalid type %s to assign to submessage field '%s'.",
-                rb_class2name(CLASS_OF(value)), name);
+        // check for possible implicit conversions
+        VALUE converted_value = NULL;
+        char* field_type_name = rb_class2name(type_class);
+
+        if (strcmp(field_type_name, "Google::Protobuf::Timestamp") == 0 &&
+            rb_obj_is_kind_of(value, rb_cTime)) {
+          // Time -> Google::Protobuf::Timestamp
+          VALUE hash = rb_hash_new();
+          rb_hash_aset(hash, rb_str_new2("seconds"), rb_funcall(value, rb_intern("to_i"), 0));
+          rb_hash_aset(hash, rb_str_new2("nanos"), rb_funcall(value, rb_intern("nsec"), 0));
+          VALUE args[1] = { hash };
+          converted_value = rb_class_new_instance(1, args, type_class);
+        } else if (strcmp(field_type_name, "Google::Protobuf::Duration") == 0 &&
+                   rb_obj_is_kind_of(value, rb_cNumeric)) {
+          // Numeric -> Google::Protobuf::Duration
+          VALUE hash = rb_hash_new();
+          rb_hash_aset(hash, rb_str_new2("seconds"), rb_funcall(value, rb_intern("to_i"), 0));
+          VALUE n_value = rb_funcall(value, rb_intern("remainder"), 1, INT2NUM(1));
+          n_value = rb_funcall(n_value, rb_intern("*"), 1, INT2NUM(1000000000));
+          n_value = rb_funcall(n_value, rb_intern("round"), 0);
+          rb_hash_aset(hash, rb_str_new2("nanos"), n_value);
+          VALUE args[1] = { hash };
+          converted_value = rb_class_new_instance(1, args, type_class);
+        }
+
+        // raise if no suitable conversaion could be found
+        if (converted_value == NULL) {
+          rb_raise(cTypeError,
+                   "Invalid type %s to assign to submessage field '%s'.",
+                  rb_class2name(CLASS_OF(value)), name);
+        } else {
+          value = converted_value;
+        }
       }
       }
       DEREF(memory, VALUE) = value;
       DEREF(memory, VALUE) = value;
       break;
       break;

File diff suppressed because it is too large
+ 439 - 382
ruby/ext/google/protobuf_c/upb.c


File diff suppressed because it is too large
+ 715 - 113
ruby/ext/google/protobuf_c/upb.h


+ 1 - 1
ruby/google-protobuf.gemspec

@@ -1,6 +1,6 @@
 Gem::Specification.new do |s|
 Gem::Specification.new do |s|
   s.name        = "google-protobuf"
   s.name        = "google-protobuf"
-  s.version     = "3.7.0"
+  s.version     = "3.7.1"
   s.licenses    = ["BSD-3-Clause"]
   s.licenses    = ["BSD-3-Clause"]
   s.summary     = "Protocol Buffers"
   s.summary     = "Protocol Buffers"
   s.description = "Protocol Buffers are Google's data interchange format."
   s.description = "Protocol Buffers are Google's data interchange format."

+ 24 - 0
ruby/tests/basic_test.proto

@@ -2,6 +2,9 @@ syntax = "proto3";
 
 
 package basic_test;
 package basic_test;
 
 
+import "google/protobuf/wrappers.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
 import "google/protobuf/struct.proto";
 import "google/protobuf/struct.proto";
 
 
 message Foo {
 message Foo {
@@ -110,6 +113,27 @@ message Outer {
 message Inner {
 message Inner {
 }
 }
 
 
+message Wrapper {
+  google.protobuf.DoubleValue double = 1;
+  google.protobuf.FloatValue float = 2;
+  google.protobuf.Int32Value int32 = 3;
+  google.protobuf.Int64Value int64 = 4;
+  google.protobuf.UInt32Value uint32 = 5;
+  google.protobuf.UInt64Value uint64 = 6;
+  google.protobuf.BoolValue bool = 7;
+  google.protobuf.StringValue string = 8;
+  google.protobuf.BytesValue bytes = 9;
+  string real_string = 100;
+  oneof a_oneof {
+    string oneof_string = 10;
+  }
+}
+
+message TimeMessage {
+  google.protobuf.Timestamp timestamp = 1;
+  google.protobuf.Duration duration = 2;
+}
+
 message Enumer {
 message Enumer {
   TestEnum optional_enum = 1;
   TestEnum optional_enum = 1;
   repeated TestEnum repeated_enum = 2;
   repeated TestEnum repeated_enum = 2;

+ 24 - 0
ruby/tests/basic_test_proto2.proto

@@ -2,6 +2,9 @@ syntax = "proto2";
 
 
 package basic_test_proto2;
 package basic_test_proto2;
 
 
+import "google/protobuf/wrappers.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
 import "google/protobuf/struct.proto";
 import "google/protobuf/struct.proto";
 
 
 message Foo {
 message Foo {
@@ -118,6 +121,27 @@ message OneofMessage {
   }
   }
 }
 }
 
 
+message Wrapper {
+  optional google.protobuf.DoubleValue double = 1;
+  optional google.protobuf.FloatValue float = 2;
+  optional google.protobuf.Int32Value int32 = 3;
+  optional google.protobuf.Int64Value int64 = 4;
+  optional google.protobuf.UInt32Value uint32 = 5;
+  optional google.protobuf.UInt64Value uint64 = 6;
+  optional google.protobuf.BoolValue bool = 7;
+  optional google.protobuf.StringValue string = 8;
+  optional google.protobuf.BytesValue bytes = 9;
+  optional string real_string = 100;
+  oneof a_oneof {
+    string oneof_string = 10;
+  }
+}
+
+message TimeMessage {
+  optional google.protobuf.Timestamp timestamp = 1;
+  optional google.protobuf.Duration duration = 2;
+}
+
 message Enumer {
 message Enumer {
   optional TestEnum optional_enum = 11;
   optional TestEnum optional_enum = 11;
   repeated TestEnum repeated_enum = 22;
   repeated TestEnum repeated_enum = 22;

+ 231 - 0
ruby/tests/common_tests.rb

@@ -1,8 +1,13 @@
+require 'google/protobuf/wrappers_pb.rb'
+
 # Defines tests which are common between proto2 and proto3 syntax.
 # Defines tests which are common between proto2 and proto3 syntax.
 #
 #
 # Requires that the proto messages are exactly the same in proto2 and proto3 syntax
 # Requires that the proto messages are exactly the same in proto2 and proto3 syntax
 # and that the including class should define a 'proto_module' method which returns
 # and that the including class should define a 'proto_module' method which returns
 # the enclosing module of the proto message classes.
 # the enclosing module of the proto message classes.
+
+require 'bigdecimal'
+
 module CommonTests
 module CommonTests
   # Ruby 2.5 changed to raise FrozenError instead of RuntimeError
   # Ruby 2.5 changed to raise FrozenError instead of RuntimeError
   FrozenErrorType = Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5') ? RuntimeError : FrozenError
   FrozenErrorType = Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5') ? RuntimeError : FrozenError
@@ -1264,6 +1269,232 @@ module CommonTests
     assert proto_module::TestMessage.new != nil
     assert proto_module::TestMessage.new != nil
   end
   end
 
 
+  def test_wrapper_getters
+    m = proto_module::Wrapper.new(
+      double: Google::Protobuf::DoubleValue.new(value: 2.0),
+      float: Google::Protobuf::FloatValue.new(value: 4.0),
+      int32: Google::Protobuf::Int32Value.new(value: 3),
+      int64: Google::Protobuf::Int64Value.new(value: 4),
+      uint32: Google::Protobuf::UInt32Value.new(value: 5),
+      uint64: Google::Protobuf::UInt64Value.new(value: 6),
+      bool: Google::Protobuf::BoolValue.new(value: true),
+      string: Google::Protobuf::StringValue.new(value: 'str'),
+      bytes: Google::Protobuf::BytesValue.new(value: 'fun'),
+      real_string: '100'
+    )
+
+    assert_equal 2.0, m.double_as_value
+    assert_equal 2.0, m.double.value
+    assert_equal 4.0, m.float_as_value
+    assert_equal 4.0, m.float.value
+    assert_equal 3, m.int32_as_value
+    assert_equal 3, m.int32.value
+    assert_equal 4, m.int64_as_value
+    assert_equal 4, m.int64.value
+    assert_equal 5, m.uint32_as_value
+    assert_equal 5, m.uint32.value
+    assert_equal 6, m.uint64_as_value
+    assert_equal 6, m.uint64.value
+    assert_equal true, m.bool_as_value
+    assert_equal true, m.bool.value
+    assert_equal 'str', m.string_as_value
+    assert_equal 'str', m.string.value
+    assert_equal 'fun', m.bytes_as_value
+    assert_equal 'fun', m.bytes.value
+  end
+
+  def test_wrapper_setters_as_value
+    m = proto_module::Wrapper.new
+
+    m.double_as_value = 4.8
+    assert_equal 4.8, m.double_as_value
+    assert_equal Google::Protobuf::DoubleValue.new(value: 4.8), m.double
+    m.float_as_value = 2.4
+    assert_in_delta 2.4, m.float_as_value
+    assert_in_delta Google::Protobuf::FloatValue.new(value: 2.4).value, m.float.value
+    m.int32_as_value = 5
+    assert_equal 5, m.int32_as_value
+    assert_equal Google::Protobuf::Int32Value.new(value: 5), m.int32
+    m.int64_as_value = 15
+    assert_equal 15, m.int64_as_value
+    assert_equal Google::Protobuf::Int64Value.new(value: 15), m.int64
+    m.uint32_as_value = 50
+    assert_equal 50, m.uint32_as_value
+    assert_equal Google::Protobuf::UInt32Value.new(value: 50), m.uint32
+    m.uint64_as_value = 500
+    assert_equal 500, m.uint64_as_value
+    assert_equal Google::Protobuf::UInt64Value.new(value: 500), m.uint64
+    m.bool_as_value = false
+    assert_equal false, m.bool_as_value
+    assert_equal Google::Protobuf::BoolValue.new(value: false), m.bool
+    m.string_as_value = 'xy'
+    assert_equal 'xy', m.string_as_value
+    assert_equal Google::Protobuf::StringValue.new(value: 'xy'), m.string
+    m.bytes_as_value = '123'
+    assert_equal '123', m.bytes_as_value
+    assert_equal Google::Protobuf::BytesValue.new(value: '123'), m.bytes
+
+    m.double_as_value = nil
+    assert_nil m.double
+    assert_nil m.double_as_value
+    m.float_as_value = nil
+    assert_nil m.float
+    assert_nil m.float_as_value
+    m.int32_as_value = nil
+    assert_nil m.int32
+    assert_nil m.int32_as_value
+    m.int64_as_value = nil
+    assert_nil m.int64
+    assert_nil m.int64_as_value
+    m.uint32_as_value = nil
+    assert_nil m.uint32
+    assert_nil m.uint32_as_value
+    m.uint64_as_value = nil
+    assert_nil m.uint64
+    assert_nil m.uint64_as_value
+    m.bool_as_value = nil
+    assert_nil m.bool
+    assert_nil m.bool_as_value
+    m.string_as_value = nil
+    assert_nil m.string
+    assert_nil m.string_as_value
+    m.bytes_as_value = nil
+    assert_nil m.bytes
+    assert_nil m.bytes_as_value
+  end
+
+  def test_wrapper_setters
+    m = proto_module::Wrapper.new
+
+    m.double = Google::Protobuf::DoubleValue.new(value: 4.8)
+    assert_equal 4.8, m.double_as_value
+    assert_equal Google::Protobuf::DoubleValue.new(value: 4.8), m.double
+    m.float = Google::Protobuf::FloatValue.new(value: 2.4)
+    assert_in_delta 2.4, m.float_as_value
+    assert_in_delta Google::Protobuf::FloatValue.new(value: 2.4).value, m.float.value
+    m.int32 = Google::Protobuf::Int32Value.new(value: 5)
+    assert_equal 5, m.int32_as_value
+    assert_equal Google::Protobuf::Int32Value.new(value: 5), m.int32
+    m.int64 = Google::Protobuf::Int64Value.new(value: 15)
+    assert_equal 15, m.int64_as_value
+    assert_equal Google::Protobuf::Int64Value.new(value: 15), m.int64
+    m.uint32 = Google::Protobuf::UInt32Value.new(value: 50)
+    assert_equal 50, m.uint32_as_value
+    assert_equal Google::Protobuf::UInt32Value.new(value: 50), m.uint32
+    m.uint64 = Google::Protobuf::UInt64Value.new(value: 500)
+    assert_equal 500, m.uint64_as_value
+    assert_equal Google::Protobuf::UInt64Value.new(value: 500), m.uint64
+    m.bool = Google::Protobuf::BoolValue.new(value: false)
+    assert_equal false, m.bool_as_value
+    assert_equal Google::Protobuf::BoolValue.new(value: false), m.bool
+    m.string = Google::Protobuf::StringValue.new(value: 'xy')
+    assert_equal 'xy', m.string_as_value
+    assert_equal Google::Protobuf::StringValue.new(value: 'xy'), m.string
+    m.bytes = Google::Protobuf::BytesValue.new(value: '123')
+    assert_equal '123', m.bytes_as_value
+    assert_equal Google::Protobuf::BytesValue.new(value: '123'), m.bytes
+
+    m.double = nil
+    assert_nil m.double
+    assert_nil m.double_as_value
+    m.float = nil
+    assert_nil m.float
+    assert_nil m.float_as_value
+    m.int32 = nil
+    assert_nil m.int32
+    assert_nil m.int32_as_value
+    m.int64 = nil
+    assert_nil m.int64
+    assert_nil m.int64_as_value
+    m.uint32 = nil
+    assert_nil m.uint32
+    assert_nil m.uint32_as_value
+    m.uint64 = nil
+    assert_nil m.uint64
+    assert_nil m.uint64_as_value
+    m.bool = nil
+    assert_nil m.bool
+    assert_nil m.bool_as_value
+    m.string = nil
+    assert_nil m.string
+    assert_nil m.string_as_value
+    m.bytes = nil
+    assert_nil m.bytes
+    assert_nil m.bytes_as_value
+  end
+
+  def test_wrappers_only
+    m = proto_module::Wrapper.new(real_string: 'hi', oneof_string: 'there')
+
+    assert_raise(NoMethodError) { m.real_string_as_value }
+    assert_raise(NoMethodError) { m.as_value }
+    assert_raise(NoMethodError) { m._as_value }
+    assert_raise(NoMethodError) { m.oneof_string_as_value }
+
+    m = proto_module::Wrapper.new
+    m.string_as_value = 'you'
+    assert_equal 'you', m.string.value
+    assert_equal 'you', m.string_as_value
+    assert_raise(NoMethodError) { m.string_ }
+    assert_raise(NoMethodError) { m.string_X }
+    assert_raise(NoMethodError) { m.string_XX }
+    assert_raise(NoMethodError) { m.string_XXX }
+    assert_raise(NoMethodError) { m.string_XXXX }
+    assert_raise(NoMethodError) { m.string_XXXXX }
+    assert_raise(NoMethodError) { m.string_XXXXXX }
+    assert_raise(NoMethodError) { m.string_XXXXXXX }
+    assert_raise(NoMethodError) { m.string_XXXXXXXX }
+    assert_raise(NoMethodError) { m.string_XXXXXXXXX }
+    assert_raise(NoMethodError) { m.string_XXXXXXXXXX }
+  end
+  
+  def test_converts_time
+    m = proto_module::TimeMessage.new
+
+    m.timestamp = Google::Protobuf::Timestamp.new(seconds: 5, nanos: 6)
+    assert_kind_of Google::Protobuf::Timestamp, m.timestamp
+    assert_equal 5, m.timestamp.seconds
+    assert_equal 6, m.timestamp.nanos
+
+    m.timestamp = Time.at(9466, 123456.789)
+    assert_equal Google::Protobuf::Timestamp.new(seconds: 9466, nanos: 123456789), m.timestamp
+
+    m = proto_module::TimeMessage.new(timestamp: Time.at(1))
+    assert_equal Google::Protobuf::Timestamp.new(seconds: 1, nanos: 0), m.timestamp
+
+    assert_raise(Google::Protobuf::TypeError) { m.timestamp = 2 }
+    assert_raise(Google::Protobuf::TypeError) { m.timestamp = 2.4 }
+    assert_raise(Google::Protobuf::TypeError) { m.timestamp = '4' }
+    assert_raise(Google::Protobuf::TypeError) { m.timestamp = proto_module::TimeMessage.new }
+  end
+
+  def test_converts_duration
+    m = proto_module::TimeMessage.new
+
+    m.duration = Google::Protobuf::Duration.new(seconds: 2, nanos: 22)
+    assert_kind_of Google::Protobuf::Duration, m.duration
+    assert_equal 2, m.duration.seconds
+    assert_equal 22, m.duration.nanos
+
+    m.duration = 10.5
+    assert_equal Google::Protobuf::Duration.new(seconds: 10, nanos: 500_000_000), m.duration
+
+    m.duration = 200
+    assert_equal Google::Protobuf::Duration.new(seconds: 200, nanos: 0), m.duration
+
+    m.duration = Rational(3, 2)
+    assert_equal Google::Protobuf::Duration.new(seconds: 1, nanos: 500_000_000), m.duration
+
+    m.duration = BigDecimal.new("5")
+    assert_equal Google::Protobuf::Duration.new(seconds: 5, nanos: 0), m.duration
+
+    m = proto_module::TimeMessage.new(duration: 1.1)
+    assert_equal Google::Protobuf::Duration.new(seconds: 1, nanos: 100_000_000), m.duration
+
+    assert_raise(Google::Protobuf::TypeError) { m.duration = '2' }
+    assert_raise(Google::Protobuf::TypeError) { m.duration = proto_module::TimeMessage.new }
+  end
+
   def test_freeze
   def test_freeze
     m = proto_module::TestMessage.new
     m = proto_module::TestMessage.new
     m.optional_int32 = 10
     m.optional_int32 = 10

+ 4 - 1
ruby/travis-test.sh

@@ -36,8 +36,11 @@ test_version() {
        cd ../ruby/compatibility_tests/v3.0.0 &&
        cd ../ruby/compatibility_tests/v3.0.0 &&
        cp -R ../../lib lib && ./test.sh"
        cp -R ../../lib lib && ./test.sh"
   else
   else
+    # Recent versions of OSX have deprecated OpenSSL, so we have to explicitly
+    # provide a path to the OpenSSL directory installed via Homebrew.
     bash --login -c \
     bash --login -c \
-      "rvm install $version && rvm use $version && \
+      "rvm install $version --with-openssl-dir=`brew --prefix openssl` && \
+       rvm use $version && \
        which ruby && \
        which ruby && \
        git clean -f && \
        git clean -f && \
        gem install bundler -v 1.17.3 && bundle && \
        gem install bundler -v 1.17.3 && bundle && \

+ 2 - 2
src/Makefile.am

@@ -18,7 +18,7 @@ else
 PTHREAD_DEF =
 PTHREAD_DEF =
 endif
 endif
 
 
-PROTOBUF_VERSION = 18:0:0
+PROTOBUF_VERSION = 18:1:0
 
 
 if GCC
 if GCC
 # Turn on all warnings except for sign comparison (we ignore sign comparison
 # Turn on all warnings except for sign comparison (we ignore sign comparison
@@ -894,7 +894,7 @@ no_warning_test.cc:
 
 
 no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
 no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
 no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
 no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
-                           -Wall -Wextra -Werror -Wno-unused-parameter -Og
+                           -Wall -Wextra -Werror -Wno-unused-parameter
 nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)
 nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)
 
 
 TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
 TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \

+ 2 - 2
src/google/protobuf/any.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -66,7 +66,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT Any final :
+class PROTOBUF_EXPORT Any :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
  public:
  public:
   Any();
   Any();

+ 4 - 4
src/google/protobuf/api.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -75,7 +75,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT Api final :
+class PROTOBUF_EXPORT Api :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
  public:
  public:
   Api();
   Api();
@@ -263,7 +263,7 @@ class PROTOBUF_EXPORT Api final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Method final :
+class PROTOBUF_EXPORT Method :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
  public:
  public:
   Method();
   Method();
@@ -442,7 +442,7 @@ class PROTOBUF_EXPORT Method final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Mixin final :
+class PROTOBUF_EXPORT Mixin :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
  public:
  public:
   Mixin();
   Mixin();

+ 1 - 1
src/google/protobuf/compiler/command_line_interface.cc

@@ -193,7 +193,7 @@ bool GetProtocAbsolutePath(std::string* path) {
 #ifdef _WIN32
 #ifdef _WIN32
   char buffer[MAX_PATH];
   char buffer[MAX_PATH];
   int len = GetModuleFileNameA(NULL, buffer, MAX_PATH);
   int len = GetModuleFileNameA(NULL, buffer, MAX_PATH);
-#elif __APPLE__
+#elif defined(__APPLE__)
   char buffer[PATH_MAX];
   char buffer[PATH_MAX];
   int len = 0;
   int len = 0;
 
 

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_message.cc

@@ -246,7 +246,7 @@ bool HasPrivateHasMethod(const FieldDescriptor* field) {
 
 
 bool ShouldMarkClassAsFinal(const Descriptor* descriptor,
 bool ShouldMarkClassAsFinal(const Descriptor* descriptor,
                             const Options& options) {
                             const Options& options) {
-  return true;
+  return false;
 }
 }
 
 
 bool ShouldMarkClearAsFinal(const Descriptor* descriptor,
 bool ShouldMarkClearAsFinal(const Descriptor* descriptor,

+ 1 - 16
src/google/protobuf/compiler/cpp/cpp_message_field.cc

@@ -45,22 +45,7 @@ namespace cpp {
 
 
 namespace {
 namespace {
 
 
-// When we are generating code for implicit weak fields, we need to insert some
-// additional casts. These functions return the casted expression if
-// implicit_weak_field is true but otherwise return the original expression.
-// Ordinarily a static_cast is enough to cast google::protobuf::MessageLite* to a class
-// deriving from it, but we need a reinterpret_cast in cases where the generated
-// message is forward-declared but its full definition is not visible.
-string StaticCast(const std::string& type, const std::string& expression,
-                  bool implicit_weak_field) {
-  if (implicit_weak_field) {
-    return "static_cast< " + type + " >(" + expression + ")";
-  } else {
-    return expression;
-  }
-}
-
-string ReinterpretCast(const std::string& type, const std::string& expression,
+string ReinterpretCast(const string& type, const string& expression,
                        bool implicit_weak_field) {
                        bool implicit_weak_field) {
   if (implicit_weak_field) {
   if (implicit_weak_field) {
     return "reinterpret_cast< " + type + " >(" + expression + ")";
     return "reinterpret_cast< " + type + " >(" + expression + ")";

+ 2 - 4
src/google/protobuf/compiler/php/php_generator.cc

@@ -1023,16 +1023,14 @@ void GenerateUseDeclaration(bool is_descriptor, io::Printer* printer) {
     printer->Print(
     printer->Print(
         "use Google\\Protobuf\\Internal\\GPBType;\n"
         "use Google\\Protobuf\\Internal\\GPBType;\n"
         "use Google\\Protobuf\\Internal\\RepeatedField;\n"
         "use Google\\Protobuf\\Internal\\RepeatedField;\n"
-        "use Google\\Protobuf\\Internal\\GPBUtil;\n"
-        "use Google\\Protobuf\\Internal\\GPBWrapperUtils;\n\n");
+        "use Google\\Protobuf\\Internal\\GPBUtil;\n\n");
   } else {
   } else {
     printer->Print(
     printer->Print(
         "use Google\\Protobuf\\Internal\\GPBType;\n"
         "use Google\\Protobuf\\Internal\\GPBType;\n"
         "use Google\\Protobuf\\Internal\\GPBWire;\n"
         "use Google\\Protobuf\\Internal\\GPBWire;\n"
         "use Google\\Protobuf\\Internal\\RepeatedField;\n"
         "use Google\\Protobuf\\Internal\\RepeatedField;\n"
         "use Google\\Protobuf\\Internal\\InputStream;\n"
         "use Google\\Protobuf\\Internal\\InputStream;\n"
-        "use Google\\Protobuf\\Internal\\GPBUtil;\n"
-        "use Google\\Protobuf\\Internal\\GPBWrapperUtils;\n\n");
+        "use Google\\Protobuf\\Internal\\GPBUtil;\n\n");
   }
   }
 }
 }
 
 

+ 5 - 5
src/google/protobuf/compiler/plugin.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -87,7 +87,7 @@ namespace compiler {
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOC_EXPORT Version final :
+class PROTOC_EXPORT Version :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ {
  public:
  public:
   Version();
   Version();
@@ -239,7 +239,7 @@ class PROTOC_EXPORT Version final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOC_EXPORT CodeGeneratorRequest final :
+class PROTOC_EXPORT CodeGeneratorRequest :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ {
  public:
  public:
   CodeGeneratorRequest();
   CodeGeneratorRequest();
@@ -409,7 +409,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOC_EXPORT CodeGeneratorResponse_File final :
+class PROTOC_EXPORT CodeGeneratorResponse_File :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ {
  public:
  public:
   CodeGeneratorResponse_File();
   CodeGeneratorResponse_File();
@@ -565,7 +565,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOC_EXPORT CodeGeneratorResponse final :
+class PROTOC_EXPORT CodeGeneratorResponse :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ {
  public:
  public:
   CodeGeneratorResponse();
   CodeGeneratorResponse();

+ 28 - 28
src/google/protobuf/descriptor.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -329,7 +329,7 @@ inline bool MethodOptions_IdempotencyLevel_Parse(
 }
 }
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT FileDescriptorSet final :
+class PROTOBUF_EXPORT FileDescriptorSet :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorSet) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorSet) */ {
  public:
  public:
   FileDescriptorSet();
   FileDescriptorSet();
@@ -471,7 +471,7 @@ class PROTOBUF_EXPORT FileDescriptorSet final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT FileDescriptorProto final :
+class PROTOBUF_EXPORT FileDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorProto) */ {
  public:
  public:
   FileDescriptorProto();
   FileDescriptorProto();
@@ -792,7 +792,7 @@ class PROTOBUF_EXPORT FileDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final :
+class PROTOBUF_EXPORT DescriptorProto_ExtensionRange :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ExtensionRange) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ExtensionRange) */ {
  public:
  public:
   DescriptorProto_ExtensionRange();
   DescriptorProto_ExtensionRange();
@@ -950,7 +950,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT DescriptorProto_ReservedRange final :
+class PROTOBUF_EXPORT DescriptorProto_ReservedRange :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ReservedRange) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ReservedRange) */ {
  public:
  public:
   DescriptorProto_ReservedRange();
   DescriptorProto_ReservedRange();
@@ -1095,7 +1095,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT DescriptorProto final :
+class PROTOBUF_EXPORT DescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto) */ {
  public:
  public:
   DescriptorProto();
   DescriptorProto();
@@ -1373,7 +1373,7 @@ class PROTOBUF_EXPORT DescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT ExtensionRangeOptions final :
+class PROTOBUF_EXPORT ExtensionRangeOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ExtensionRangeOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ExtensionRangeOptions) */ {
  public:
  public:
   ExtensionRangeOptions();
   ExtensionRangeOptions();
@@ -1518,7 +1518,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT FieldDescriptorProto final :
+class PROTOBUF_EXPORT FieldDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldDescriptorProto) */ {
  public:
  public:
   FieldDescriptorProto();
   FieldDescriptorProto();
@@ -1901,7 +1901,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT OneofDescriptorProto final :
+class PROTOBUF_EXPORT OneofDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofDescriptorProto) */ {
  public:
  public:
   OneofDescriptorProto();
   OneofDescriptorProto();
@@ -2066,7 +2066,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final :
+class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ {
  public:
  public:
   EnumDescriptorProto_EnumReservedRange();
   EnumDescriptorProto_EnumReservedRange();
@@ -2211,7 +2211,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT EnumDescriptorProto final :
+class PROTOBUF_EXPORT EnumDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto) */ {
  public:
  public:
   EnumDescriptorProto();
   EnumDescriptorProto();
@@ -2423,7 +2423,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT EnumValueDescriptorProto final :
+class PROTOBUF_EXPORT EnumValueDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueDescriptorProto) */ {
  public:
  public:
   EnumValueDescriptorProto();
   EnumValueDescriptorProto();
@@ -2596,7 +2596,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT ServiceDescriptorProto final :
+class PROTOBUF_EXPORT ServiceDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceDescriptorProto) */ {
  public:
  public:
   ServiceDescriptorProto();
   ServiceDescriptorProto();
@@ -2774,7 +2774,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT MethodDescriptorProto final :
+class PROTOBUF_EXPORT MethodDescriptorProto :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodDescriptorProto) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodDescriptorProto) */ {
  public:
  public:
   MethodDescriptorProto();
   MethodDescriptorProto();
@@ -3001,7 +3001,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT FileOptions final :
+class PROTOBUF_EXPORT FileOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileOptions) */ {
  public:
  public:
   FileOptions();
   FileOptions();
@@ -3488,7 +3488,7 @@ class PROTOBUF_EXPORT FileOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT MessageOptions final :
+class PROTOBUF_EXPORT MessageOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MessageOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MessageOptions) */ {
  public:
  public:
   MessageOptions();
   MessageOptions();
@@ -3665,7 +3665,7 @@ class PROTOBUF_EXPORT MessageOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT FieldOptions final :
+class PROTOBUF_EXPORT FieldOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ {
  public:
  public:
   FieldOptions();
   FieldOptions();
@@ -3922,7 +3922,7 @@ class PROTOBUF_EXPORT FieldOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT OneofOptions final :
+class PROTOBUF_EXPORT OneofOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofOptions) */ {
  public:
  public:
   OneofOptions();
   OneofOptions();
@@ -4067,7 +4067,7 @@ class PROTOBUF_EXPORT OneofOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT EnumOptions final :
+class PROTOBUF_EXPORT EnumOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumOptions) */ {
  public:
  public:
   EnumOptions();
   EnumOptions();
@@ -4228,7 +4228,7 @@ class PROTOBUF_EXPORT EnumOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT EnumValueOptions final :
+class PROTOBUF_EXPORT EnumValueOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueOptions) */ {
  public:
  public:
   EnumValueOptions();
   EnumValueOptions();
@@ -4381,7 +4381,7 @@ class PROTOBUF_EXPORT EnumValueOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT ServiceOptions final :
+class PROTOBUF_EXPORT ServiceOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceOptions) */ {
  public:
  public:
   ServiceOptions();
   ServiceOptions();
@@ -4534,7 +4534,7 @@ class PROTOBUF_EXPORT ServiceOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT MethodOptions final :
+class PROTOBUF_EXPORT MethodOptions :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodOptions) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodOptions) */ {
  public:
  public:
   MethodOptions();
   MethodOptions();
@@ -4727,7 +4727,7 @@ class PROTOBUF_EXPORT MethodOptions final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT UninterpretedOption_NamePart final :
+class PROTOBUF_EXPORT UninterpretedOption_NamePart :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption.NamePart) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption.NamePart) */ {
  public:
  public:
   UninterpretedOption_NamePart();
   UninterpretedOption_NamePart();
@@ -4890,7 +4890,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT UninterpretedOption final :
+class PROTOBUF_EXPORT UninterpretedOption :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption) */ {
  public:
  public:
   UninterpretedOption();
   UninterpretedOption();
@@ -5127,7 +5127,7 @@ class PROTOBUF_EXPORT UninterpretedOption final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT SourceCodeInfo_Location final :
+class PROTOBUF_EXPORT SourceCodeInfo_Location :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ {
  public:
  public:
   SourceCodeInfo_Location();
   SourceCodeInfo_Location();
@@ -5349,7 +5349,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT SourceCodeInfo final :
+class PROTOBUF_EXPORT SourceCodeInfo :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo) */ {
  public:
  public:
   SourceCodeInfo();
   SourceCodeInfo();
@@ -5493,7 +5493,7 @@ class PROTOBUF_EXPORT SourceCodeInfo final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final :
+class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo.Annotation) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo.Annotation) */ {
  public:
  public:
   GeneratedCodeInfo_Annotation();
   GeneratedCodeInfo_Annotation();
@@ -5675,7 +5675,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT GeneratedCodeInfo final :
+class PROTOBUF_EXPORT GeneratedCodeInfo :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo) */ {
  public:
  public:
   GeneratedCodeInfo();
   GeneratedCodeInfo();

+ 2 - 2
src/google/protobuf/duration.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -65,7 +65,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT Duration final :
+class PROTOBUF_EXPORT Duration :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ {
  public:
  public:
   Duration();
   Duration();

+ 2 - 2
src/google/protobuf/empty.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -65,7 +65,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT Empty final :
+class PROTOBUF_EXPORT Empty :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {
  public:
  public:
   Empty();
   Empty();

+ 2 - 2
src/google/protobuf/field_mask.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -65,7 +65,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT FieldMask final :
+class PROTOBUF_EXPORT FieldMask :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {
  public:
  public:
   FieldMask();
   FieldMask();

+ 5 - 1
src/google/protobuf/port_def.inc

@@ -97,6 +97,9 @@
 #ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
 #ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
 #error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
 #error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
 #endif
 #endif
+#ifdef PROTOBUF_MIN_PROTOC_VERSION
+#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
+#endif
 #ifdef PROTOBUF_PREDICT_TRUE
 #ifdef PROTOBUF_PREDICT_TRUE
 #error PROTOBUF_PREDICT_TRUE was previously defined
 #error PROTOBUF_PREDICT_TRUE was previously defined
 #endif
 #endif
@@ -282,8 +285,9 @@
 
 
 // Shared google3/opensource definitions. //////////////////////////////////////
 // Shared google3/opensource definitions. //////////////////////////////////////
 
 
-#define PROTOBUF_VERSION 3007000
+#define PROTOBUF_VERSION 3007001
 #define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3007000
 #define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3007000
+#define PROTOBUF_MIN_PROTOC_VERSION 3007000
 #define PROTOBUF_VERSION_SUFFIX ""
 #define PROTOBUF_VERSION_SUFFIX ""
 
 
 // The minimum library version which works with the current version of the
 // The minimum library version which works with the current version of the

+ 1 - 0
src/google/protobuf/port_undef.inc

@@ -50,6 +50,7 @@
 #undef PROTOBUF_VERSION_SUFFIX
 #undef PROTOBUF_VERSION_SUFFIX
 #undef PROTOBUF_FIELD_OFFSET
 #undef PROTOBUF_FIELD_OFFSET
 #undef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
 #undef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
+#undef PROTOBUF_MIN_PROTOC_VERSION
 #undef PROTOBUF_PREDICT_TRUE
 #undef PROTOBUF_PREDICT_TRUE
 #undef PROTOBUF_PREDICT_FALSE
 #undef PROTOBUF_PREDICT_FALSE
 #undef PROTOBUF_LONGLONG
 #undef PROTOBUF_LONGLONG

+ 2 - 2
src/google/protobuf/source_context.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -65,7 +65,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT SourceContext final :
+class PROTOBUF_EXPORT SourceContext :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ {
  public:
  public:
   SourceContext();
   SourceContext();

+ 4 - 4
src/google/protobuf/struct.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -130,7 +130,7 @@ public:
 
 
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Struct final :
+class PROTOBUF_EXPORT Struct :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Struct) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Struct) */ {
  public:
  public:
   Struct();
   Struct();
@@ -267,7 +267,7 @@ class PROTOBUF_EXPORT Struct final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Value final :
+class PROTOBUF_EXPORT Value :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ {
  public:
  public:
   Value();
   Value();
@@ -495,7 +495,7 @@ class PROTOBUF_EXPORT Value final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT ListValue final :
+class PROTOBUF_EXPORT ListValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ {
  public:
  public:
   ListValue();
   ListValue();

+ 1 - 5
src/google/protobuf/stubs/common.h

@@ -81,15 +81,11 @@ namespace internal {
 
 
 // The current version, represented as a single integer to make comparison
 // The current version, represented as a single integer to make comparison
 // easier:  major * 10^6 + minor * 10^3 + micro
 // easier:  major * 10^6 + minor * 10^3 + micro
-#define GOOGLE_PROTOBUF_VERSION 3007000
+#define GOOGLE_PROTOBUF_VERSION 3007001
 
 
 // A suffix string for alpha, beta or rc releases. Empty for stable releases.
 // A suffix string for alpha, beta or rc releases. Empty for stable releases.
 #define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
 #define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
 
 
-// The minimum library version which works with the current version of the
-// headers.
-#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3007000
-
 // The minimum header version which works with the current version of
 // The minimum header version which works with the current version of
 // the library.  This constant should only be used by protoc's C++ code
 // the library.  This constant should only be used by protoc's C++ code
 // generator.
 // generator.

+ 0 - 55
src/google/protobuf/stubs/mathlimits.cc

@@ -40,42 +40,6 @@
 namespace google {
 namespace google {
 namespace protobuf {
 namespace protobuf {
 
 
-// MSVC++ 2005 and older compilers think the header declaration was a
-// definition, and erroneously flag these as a duplicate definition.
-#if defined(COMPILER_MSVC) || __cpluscplus < 201103L
-
-#define DEF_COMMON_LIMITS(Type)
-#define DEF_UNSIGNED_INT_LIMITS(Type)
-#define DEF_SIGNED_INT_LIMITS(Type)
-#define DEF_PRECISION_LIMITS(Type)
-
-#else
-
-#define DEF_COMMON_LIMITS(Type) \
-const bool MathLimits<Type>::kIsSigned; \
-const bool MathLimits<Type>::kIsInteger; \
-const int MathLimits<Type>::kMin10Exp; \
-const int MathLimits<Type>::kMax10Exp;
-
-#define DEF_UNSIGNED_INT_LIMITS(Type) \
-DEF_COMMON_LIMITS(Type) \
-const Type MathLimits<Type>::kPosMin; \
-const Type MathLimits<Type>::kPosMax; \
-const Type MathLimits<Type>::kMin; \
-const Type MathLimits<Type>::kMax; \
-const Type MathLimits<Type>::kEpsilon; \
-const Type MathLimits<Type>::kStdError;
-
-#define DEF_SIGNED_INT_LIMITS(Type) \
-DEF_UNSIGNED_INT_LIMITS(Type) \
-const Type MathLimits<Type>::kNegMin; \
-const Type MathLimits<Type>::kNegMax;
-
-#define DEF_PRECISION_LIMITS(Type) \
-const int MathLimits<Type>::kPrecisionDigits;
-
-#endif  // not COMPILER_MSVC
-
 // http://en.wikipedia.org/wiki/Quadruple_precision_floating-point_format#Double-double_arithmetic
 // http://en.wikipedia.org/wiki/Quadruple_precision_floating-point_format#Double-double_arithmetic
 // With some compilers (gcc 4.6.x) on some platforms (powerpc64),
 // With some compilers (gcc 4.6.x) on some platforms (powerpc64),
 // "long double" is implemented as a pair of double: "double double" format.
 // "long double" is implemented as a pair of double: "double double" format.
@@ -101,7 +65,6 @@ const int MathLimits<Type>::kPrecisionDigits;
 // max(DBL_EPSILON * DBL_EPSILON, kEpsilon) rather than a multiple of kEpsilon.
 // max(DBL_EPSILON * DBL_EPSILON, kEpsilon) rather than a multiple of kEpsilon.
 
 
 #define DEF_FP_LIMITS(Type, PREFIX) \
 #define DEF_FP_LIMITS(Type, PREFIX) \
-DEF_COMMON_LIMITS(Type) \
 const Type MathLimits<Type>::kPosMin = PREFIX##_MIN; \
 const Type MathLimits<Type>::kPosMin = PREFIX##_MIN; \
 const Type MathLimits<Type>::kPosMax = PREFIX##_MAX; \
 const Type MathLimits<Type>::kPosMax = PREFIX##_MAX; \
 const Type MathLimits<Type>::kMin = -MathLimits<Type>::kPosMax; \
 const Type MathLimits<Type>::kMin = -MathLimits<Type>::kPosMax; \
@@ -113,32 +76,14 @@ const Type MathLimits<Type>::kEpsilon = PREFIX##_EPSILON; \
 const Type MathLimits<Type>::kStdError = \
 const Type MathLimits<Type>::kStdError = \
   32 * (DBL_EPSILON * DBL_EPSILON > MathLimits<Type>::kEpsilon \
   32 * (DBL_EPSILON * DBL_EPSILON > MathLimits<Type>::kEpsilon \
       ? DBL_EPSILON * DBL_EPSILON : MathLimits<Type>::kEpsilon); \
       ? DBL_EPSILON * DBL_EPSILON : MathLimits<Type>::kEpsilon); \
-DEF_PRECISION_LIMITS(Type) \
 const Type MathLimits<Type>::kNaN = HUGE_VAL - HUGE_VAL; \
 const Type MathLimits<Type>::kNaN = HUGE_VAL - HUGE_VAL; \
 const Type MathLimits<Type>::kPosInf = HUGE_VAL; \
 const Type MathLimits<Type>::kPosInf = HUGE_VAL; \
 const Type MathLimits<Type>::kNegInf = -HUGE_VAL;
 const Type MathLimits<Type>::kNegInf = -HUGE_VAL;
 
 
-// The following are *not* casts!
-DEF_SIGNED_INT_LIMITS(int8)
-DEF_SIGNED_INT_LIMITS(int16)  // NOLINT(readability/casting)
-DEF_SIGNED_INT_LIMITS(int32)  // NOLINT(readability/casting)
-DEF_SIGNED_INT_LIMITS(int64)  // NOLINT(readability/casting)
-DEF_UNSIGNED_INT_LIMITS(uint8)
-DEF_UNSIGNED_INT_LIMITS(uint16)  // NOLINT(readability/casting)
-DEF_UNSIGNED_INT_LIMITS(uint32)  // NOLINT(readability/casting)
-DEF_UNSIGNED_INT_LIMITS(uint64)  // NOLINT(readability/casting)
-
-DEF_SIGNED_INT_LIMITS(long int)
-DEF_UNSIGNED_INT_LIMITS(unsigned long int)
-
 DEF_FP_LIMITS(float, FLT)
 DEF_FP_LIMITS(float, FLT)
 DEF_FP_LIMITS(double, DBL)
 DEF_FP_LIMITS(double, DBL)
 DEF_FP_LIMITS(long double, LDBL);
 DEF_FP_LIMITS(long double, LDBL);
 
 
-#undef DEF_COMMON_LIMITS
-#undef DEF_SIGNED_INT_LIMITS
-#undef DEF_UNSIGNED_INT_LIMITS
 #undef DEF_FP_LIMITS
 #undef DEF_FP_LIMITS
-#undef DEF_PRECISION_LIMITS
 }  // namespace protobuf
 }  // namespace protobuf
 }  // namespace google
 }  // namespace google

+ 1 - 1
src/google/protobuf/stubs/mathlimits.h

@@ -245,7 +245,7 @@ DECL_UNSIGNED_INT_LIMITS(unsigned long long int)
 #endif
 #endif
 
 
 // ========================================================================= //
 // ========================================================================= //
-#if WIN32 && !__MINGW32__ // Lacks built-in isnan() and isinf()
+#if defined(_WIN32) && !defined(__MINGW32__) // Lacks built-in isnan() and isinf()
 #define DECL_FP_LIMIT_FUNCS \
 #define DECL_FP_LIMIT_FUNCS \
   static bool IsFinite(const Type x) { return _finite(x); } \
   static bool IsFinite(const Type x) { return _finite(x); } \
   static bool IsNaN(const Type x) { return _isnan(x); } \
   static bool IsNaN(const Type x) { return _isnan(x); } \

+ 4 - 2
src/google/protobuf/stubs/strutil.cc

@@ -1116,10 +1116,12 @@ char* FastUInt64ToBufferLeft(uint64 u64, char* buffer) {
 }
 }
 
 
 char* FastInt64ToBufferLeft(int64 i, char* buffer) {
 char* FastInt64ToBufferLeft(int64 i, char* buffer) {
-  uint64 u = i;
+  uint64 u = 0;
   if (i < 0) {
   if (i < 0) {
     *buffer++ = '-';
     *buffer++ = '-';
-    u = -i;
+    u -= i;
+  } else {
+    u = i;
   }
   }
   return FastUInt64ToBufferLeft(u, buffer);
   return FastUInt64ToBufferLeft(u, buffer);
 }
 }

+ 1 - 0
src/google/protobuf/test_messages_proto3.proto

@@ -206,6 +206,7 @@ message TestAllTypesProto3 {
   repeated google.protobuf.Struct repeated_struct = 324;
   repeated google.protobuf.Struct repeated_struct = 324;
   repeated google.protobuf.Any repeated_any = 315;
   repeated google.protobuf.Any repeated_any = 315;
   repeated google.protobuf.Value repeated_value = 316;
   repeated google.protobuf.Value repeated_value = 316;
+  repeated google.protobuf.ListValue repeated_list_value = 317;
 
 
   // Test field-name-to-JSON-name convention.
   // Test field-name-to-JSON-name convention.
   // (protobuf says names can be any valid C/C++ identifier.)
   // (protobuf says names can be any valid C/C++ identifier.)

+ 3 - 1
src/google/protobuf/text_format.cc

@@ -1315,7 +1315,9 @@ class TextFormat::Printer::TextGenerator
     while (size > buffer_size_) {
     while (size > buffer_size_) {
       // Data exceeds space in the buffer. Write what we can and request a new
       // Data exceeds space in the buffer. Write what we can and request a new
       // buffer.
       // buffer.
-      memset(buffer_, ' ', buffer_size_);
+      if (buffer_size_ > 0) {
+        memset(buffer_, ' ', buffer_size_);
+      }
       size -= buffer_size_;
       size -= buffer_size_;
       void* void_buffer;
       void* void_buffer;
       failed_ = !output_->Next(&void_buffer, &buffer_size_);
       failed_ = !output_->Next(&void_buffer, &buffer_size_);

+ 2 - 2
src/google/protobuf/timestamp.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -65,7 +65,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT Timestamp final :
+class PROTOBUF_EXPORT Timestamp :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ {
  public:
  public:
   Timestamp();
   Timestamp();

+ 6 - 6
src/google/protobuf/type.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -178,7 +178,7 @@ inline bool Syntax_Parse(
 }
 }
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT Type final :
+class PROTOBUF_EXPORT Type :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ {
  public:
  public:
   Type();
   Type();
@@ -386,7 +386,7 @@ class PROTOBUF_EXPORT Type final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Field final :
+class PROTOBUF_EXPORT Field :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ {
  public:
  public:
   Field();
   Field();
@@ -741,7 +741,7 @@ class PROTOBUF_EXPORT Field final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Enum final :
+class PROTOBUF_EXPORT Enum :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ {
  public:
  public:
   Enum();
   Enum();
@@ -930,7 +930,7 @@ class PROTOBUF_EXPORT Enum final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT EnumValue final :
+class PROTOBUF_EXPORT EnumValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ {
  public:
  public:
   EnumValue();
   EnumValue();
@@ -1093,7 +1093,7 @@ class PROTOBUF_EXPORT EnumValue final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Option final :
+class PROTOBUF_EXPORT Option :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ {
  public:
  public:
   Option();
   Option();

+ 10 - 10
src/google/protobuf/wrappers.pb.h

@@ -13,7 +13,7 @@
 #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #error your headers.
 #endif
 #endif
-#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3007001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
@@ -97,7 +97,7 @@ PROTOBUF_NAMESPACE_OPEN
 
 
 // ===================================================================
 // ===================================================================
 
 
-class PROTOBUF_EXPORT DoubleValue final :
+class PROTOBUF_EXPORT DoubleValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ {
  public:
  public:
   DoubleValue();
   DoubleValue();
@@ -225,7 +225,7 @@ class PROTOBUF_EXPORT DoubleValue final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT FloatValue final :
+class PROTOBUF_EXPORT FloatValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FloatValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FloatValue) */ {
  public:
  public:
   FloatValue();
   FloatValue();
@@ -353,7 +353,7 @@ class PROTOBUF_EXPORT FloatValue final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Int64Value final :
+class PROTOBUF_EXPORT Int64Value :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int64Value) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int64Value) */ {
  public:
  public:
   Int64Value();
   Int64Value();
@@ -481,7 +481,7 @@ class PROTOBUF_EXPORT Int64Value final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT UInt64Value final :
+class PROTOBUF_EXPORT UInt64Value :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt64Value) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt64Value) */ {
  public:
  public:
   UInt64Value();
   UInt64Value();
@@ -609,7 +609,7 @@ class PROTOBUF_EXPORT UInt64Value final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT Int32Value final :
+class PROTOBUF_EXPORT Int32Value :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int32Value) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int32Value) */ {
  public:
  public:
   Int32Value();
   Int32Value();
@@ -737,7 +737,7 @@ class PROTOBUF_EXPORT Int32Value final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT UInt32Value final :
+class PROTOBUF_EXPORT UInt32Value :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt32Value) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt32Value) */ {
  public:
  public:
   UInt32Value();
   UInt32Value();
@@ -865,7 +865,7 @@ class PROTOBUF_EXPORT UInt32Value final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT BoolValue final :
+class PROTOBUF_EXPORT BoolValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BoolValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BoolValue) */ {
  public:
  public:
   BoolValue();
   BoolValue();
@@ -993,7 +993,7 @@ class PROTOBUF_EXPORT BoolValue final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT StringValue final :
+class PROTOBUF_EXPORT StringValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.StringValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.StringValue) */ {
  public:
  public:
   StringValue();
   StringValue();
@@ -1136,7 +1136,7 @@ class PROTOBUF_EXPORT StringValue final :
 };
 };
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 
 
-class PROTOBUF_EXPORT BytesValue final :
+class PROTOBUF_EXPORT BytesValue :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BytesValue) */ {
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BytesValue) */ {
  public:
  public:
   BytesValue();
   BytesValue();

Some files were not shown because too many files changed in this diff