Avoid assert when collecting vtables
This commit is contained in:
parent
d06b961a4a
commit
4c5ebd7609
|
@ -425,7 +425,10 @@ struct serializable_traits<RequestStream<T>> : std::true_type {
|
|||
} else {
|
||||
const auto& ep = stream.getEndpoint();
|
||||
serializer(ar, ep);
|
||||
UNSTOPPABLE_ASSERT(ep.getPrimaryAddress().isValid()); // No serializing PromiseStreams on a client with no public address
|
||||
if constexpr (Archiver::isSerializing) { // Don't assert this when collecting vtable for flatbuffers
|
||||
UNSTOPPABLE_ASSERT(ep.getPrimaryAddress()
|
||||
.isValid()); // No serializing PromiseStreams on a client with no public address
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -542,6 +542,7 @@ private:
|
|||
|
||||
struct InsertVTableLambda {
|
||||
static constexpr bool isDeserializing = false;
|
||||
static constexpr bool isSerializing = false;
|
||||
static constexpr bool is_fb_visitor = true;
|
||||
std::set<const VTable*>& vtables;
|
||||
std::set<std::type_index>& known_types;
|
||||
|
@ -665,6 +666,7 @@ private:
|
|||
template <class Writer>
|
||||
struct SaveVisitorLambda {
|
||||
static constexpr bool isDeserializing = false;
|
||||
static constexpr bool isSerializing = true;
|
||||
static constexpr bool is_fb_visitor = true;
|
||||
const VTableSet* vtableset;
|
||||
Writer& writer;
|
||||
|
@ -738,6 +740,7 @@ struct SaveVisitorLambda {
|
|||
template <class Context>
|
||||
struct LoadMember {
|
||||
static constexpr bool isDeserializing = true;
|
||||
static constexpr bool isSerializing = false;
|
||||
const uint16_t* const vtable;
|
||||
const uint8_t* const message;
|
||||
const uint16_t vtable_length;
|
||||
|
@ -852,6 +855,7 @@ struct LoadSaveHelper {
|
|||
template <class Context>
|
||||
struct SerializeFun {
|
||||
static constexpr bool isDeserializing = true;
|
||||
static constexpr bool isSerializing = false;
|
||||
static constexpr bool is_fb_visitor = true;
|
||||
|
||||
const uint16_t* vtable;
|
||||
|
|
|
@ -317,6 +317,7 @@ inline _Unversioned Unversioned() { return _Unversioned(); }
|
|||
class BinaryWriter : NonCopyable {
|
||||
public:
|
||||
static const int isDeserializing = 0;
|
||||
static constexpr bool isSerializing = true;
|
||||
typedef BinaryWriter WRITER;
|
||||
|
||||
void serializeBytes( StringRef bytes ) {
|
||||
|
@ -518,6 +519,7 @@ private:
|
|||
class ArenaReader {
|
||||
public:
|
||||
static const int isDeserializing = 1;
|
||||
static constexpr bool isSerializing = false;
|
||||
typedef ArenaReader READER;
|
||||
|
||||
const void* readBytes( int bytes ) {
|
||||
|
@ -583,6 +585,7 @@ private:
|
|||
class BinaryReader {
|
||||
public:
|
||||
static const int isDeserializing = 1;
|
||||
static constexpr bool isSerializing = false;
|
||||
typedef BinaryReader READER;
|
||||
|
||||
const void* readBytes( int bytes );
|
||||
|
@ -682,6 +685,7 @@ struct PacketBuffer : SendBuffer, FastAllocated<PacketBuffer> {
|
|||
|
||||
struct PacketWriter {
|
||||
static const int isDeserializing = 0;
|
||||
static constexpr bool isSerializing = 1;
|
||||
typedef PacketWriter WRITER;
|
||||
|
||||
PacketBuffer* buffer;
|
||||
|
|
Loading…
Reference in New Issue