Fixed more bugs surfaced by Travis.

pull/13171/head
Josh Haberman 8 years ago
parent 39c2414d68
commit e977c0af03
  1. 2
      Makefile
  2. 6
      upb/bindings/googlepb/proto2.cc
  3. 16
      upb/msg.h

@ -250,6 +250,8 @@ obj/upb/%.lo: upb/%.cc | $$(@D)/.
# Regenerating the auto-generated files in upb/. # Regenerating the auto-generated files in upb/.
upb/descriptor/descriptor.pb: upb/descriptor/descriptor.proto upb/descriptor/descriptor.pb: upb/descriptor/descriptor.proto
$(E) PROTOC upb/descriptor/descriptor.proto
$(Q) protoc upb/descriptor/descriptor.proto -oupb/descriptor/descriptor.pb
# "genfiles" includes Proto schemas we need for tests # "genfiles" includes Proto schemas we need for tests
# For the moment we check in the *.upbdefs.* generated files so that people # For the moment we check in the *.upbdefs.* generated files so that people

@ -12,10 +12,10 @@
#include <map> #include <map>
#include "upb/def.h"
#include "upb/bindings/googlepb/proto1.int.h" #include "upb/bindings/googlepb/proto1.int.h"
#include "upb/def.h"
#include "upb/handlers.h" #include "upb/handlers.h"
#include "upb/shim/shim.h" #include "upb/msg.h"
#include "upb/sink.h" #include "upb/sink.h"
namespace { namespace {
@ -593,7 +593,7 @@ case goog::FieldDescriptor::cpptype: \
SetStartRepeatedField<T>(proto2_f, r, f, h); SetStartRepeatedField<T>(proto2_f, r, f, h);
CHKRET(h->SetValueHandler<T>(f, UpbMakeHandlerT(AppendPrimitive<T>))); CHKRET(h->SetValueHandler<T>(f, UpbMakeHandlerT(AppendPrimitive<T>)));
} else { } else {
CHKRET(upb::Shim::Set(h, f, GetOffset(proto2_f, r), CHKRET(upb_msg_setscalarhandler(h, f, GetOffset(proto2_f, r),
GetHasbit(proto2_f, r))); GetHasbit(proto2_f, r)));
} }
} }

@ -32,8 +32,13 @@
#ifdef __cplusplus #ifdef __cplusplus
namespace upb { namespace upb {
class MessageLayout; class Array;
class Map;
class MapIterator;
class MessageFactory; class MessageFactory;
class MessageLayout;
class Visitor;
class VisitorPlan;
} }
#endif #endif
@ -110,6 +115,9 @@ typedef union {
int64_t i64; int64_t i64;
uint32_t u32; uint32_t u32;
uint64_t u64; uint64_t u64;
const upb_map* map;
const upb_msg* msg;
const upb_array* arr;
const void* ptr; const void* ptr;
struct { struct {
const char *ptr; const char *ptr;
@ -137,10 +145,10 @@ ACCESSORS(int32, i32, int32_t)
ACCESSORS(int64, i64, int64_t) ACCESSORS(int64, i64, int64_t)
ACCESSORS(uint32, u32, uint32_t) ACCESSORS(uint32, u32, uint32_t)
ACCESSORS(uint64, u64, uint64_t) ACCESSORS(uint64, u64, uint64_t)
ACCESSORS(map, ptr, const upb_map*) ACCESSORS(map, map, const upb_map*)
ACCESSORS(msg, ptr, const upb_msg*) ACCESSORS(msg, msg, const upb_msg*)
ACCESSORS(ptr, ptr, const void*) ACCESSORS(ptr, ptr, const void*)
ACCESSORS(arr, ptr, const upb_array*) ACCESSORS(arr, arr, const upb_array*)
#undef ACCESSORS #undef ACCESSORS

Loading…
Cancel
Save