Merge pull request #10188 from aladram/patch-2

Add explicit abort() at the end of AlignFail
pull/10244/head
Matt Fowles Kulukundis 3 years ago committed by GitHub
commit 74abfe447c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/google/protobuf/generated_message_tctable_impl.h

@ -32,6 +32,7 @@
#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_IMPL_H__
#include <cstdint>
#include <cstdlib>
#include <type_traits>
#include <google/protobuf/port.h>
@ -262,11 +263,11 @@ enum FieldType : uint16_t {
#ifndef NDEBUG
template <size_t align>
#ifndef _MSC_VER
[[noreturn]]
#endif
void AlignFail(uintptr_t address) {
GOOGLE_LOG(FATAL) << "Unaligned (" << align << ") access at " << address;
// Explicit abort to let compilers know this function does not return
abort();
}
extern template void AlignFail<4>(uintptr_t);

Loading…
Cancel
Save