43__KERNEL_RCSID(0,
"$NetBSD: ubsan.c,v 1.3 2018/08/03 16:31:04 kamil Exp $");
45__RCSID(
"$NetBSD: ubsan.c,v 1.3 2018/08/03 16:31:04 kamil Exp $");
52#include <sys/limits.h>
54#include <machine/_inttypes.h>
55#include <machine/stdarg.h>
56#define ASSERT(x) KASSERT(x, ("%s: " __STRING(x) " failed", __func__))
57#define __arraycount(x) nitems(x)
58#define ISSET(x, y) ((x) & (y))
59#define __BIT(x) ((uintmax_t)1 << (uintmax_t)(x))
60#define __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask))
61#define __SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask))
81#define ubsan_vsyslog vsyslog_ss
82#define ASSERT(x) _DIAGASSERT(x)
84#define ubsan_vsyslog vsyslog_r
85#define ASSERT(x) assert(x)
88#define SET(t, f) ((t) |= (f))
89#define ISSET(t, f) ((t) & (f))
90#define CLR(t, f) ((t) &= ~(f))
93#define REINTERPRET_CAST(__dt, __st) ((__dt)(__st))
94#define STATIC_CAST(__dt, __st) ((__dt)(__st))
96#define ACK_REPORTED __BIT(31)
99#define PLUS_STRING "+"
100#define MINUS_STRING "-"
101#define DIVREM_STRING "divrem"
105#define CFI_DERIVEDCAST 2
106#define CFI_UNRELATEDCAST 3
108#define CFI_NVMFCALL 5
111#define NUMBER_MAXLEN 128
112#define LOCATION_MAXLEN (PATH_MAX + 32 )
122#define NUMBER_SIGNED_BIT 1U
133static int ubsan_flags = -1;
134#define UBSAN_ABORT __BIT(0)
135#define UBSAN_STDOUT __BIT(1)
136#define UBSAN_STDERR __BIT(2)
137#define UBSAN_SYSLOG __BIT(3)
142#define KIND_INTEGER 0
144#define KIND_UNKNOWN UINT16_MAX
253static void Report(
bool isFatal,
const char *pFormat, ...) __printflike(2, 3);
257#ifdef __SIZEOF_INT128__
258static void DeserializeUINT128(
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType, __uint128_t U128);
263static void DeserializeFloatOverPointer(
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType,
unsigned long *pNumber);
264static void DeserializeFloatInlined(
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType,
unsigned long ulNumber);
269static void DeserializeNumberFloat(
char *szLocation,
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType,
unsigned long ulNumber);
329void __ubsan_get_current_report_data(
const char **ppOutIssueKind,
const char **ppOutMessage,
const char **ppOutFilename, uint32_t *pOutLine, uint32_t *pOutCol,
char **ppOutMemoryAddr);
331static void HandleOverflow(
bool isFatal,
struct COverflowData *pData,
unsigned long ulLHS,
unsigned long ulRHS,
const char *szOperation);
341static void HandleCFIBadType(
bool isFatal,
struct CCFICheckFailData *pData,
unsigned long ulVtable,
bool *bValidVtable,
bool *FromUnrecoverableHandler,
unsigned long *ProgramCounter,
unsigned long *FramePointer);
366 Report(isFatal,
"UBSan: Undefined Behavior in %s, %s integer overflow: %s %s %s cannot be represented in type %s\n",
384 Report(isFatal,
"UBSan: Undefined Behavior in %s, negation of %s cannot be represented in type %s\n",
400 Report(isFatal,
"UBSan: Undefined Behavior in %s, calling __builtin_unreachable()\n",
417 if (ulPointer == 0) {
418 Report(isFatal,
"UBSan: Undefined Behavior in %s, %s null pointer of type %s\n",
420 }
else if ((mLogAlignment - 1) & ulPointer) {
421 Report(isFatal,
"UBSan: Undefined Behavior in %s, %s misaligned address %p for type %s which requires %ld byte alignment\n",
424 Report(isFatal,
"UBSan: Undefined Behavior in %s, %s address %p with insufficient space for an object of type %s\n",
443 Report(isFatal,
"UBSan: Undefined Behavior in %s, variable length array bound value %s <= 0\n",
444 szLocation, szBound);
461 Report(isFatal,
"UBSan: Undefined Behavior in %s, index %s is out of range for type %s\n",
482 Report(isFatal,
"UBSan: Undefined Behavior in %s, shift exponent %s is negative\n",
485 Report(isFatal,
"UBSan: Undefined Behavior in %s, shift exponent %s is too large for %zu-bit type %s\n",
488 Report(isFatal,
"UBSan: Undefined Behavior in %s, left shift of negative value %s\n",
491 Report(isFatal,
"UBSan: Undefined Behavior in %s, left shift of %s by %s places cannot be represented in type %s\n",
509 Report(isFatal,
"UBSan: Undefined Behavior in %s, load of value %s is not a valid value for type %s\n",
525 Report(isFatal,
"UBSan: Undefined Behavior in %s, passing zero to %s, which is not a valid argument\n",
551 Report(isFatal,
"UBSan: Undefined Behavior in %s, call to function %#lx through pointer to incorrect function type %s\n",
556HandleCFIBadType(
bool isFatal,
struct CCFICheckFailData *pData,
unsigned long ulVtable,
bool *bValidVtable,
bool *FromUnrecoverableHandler,
unsigned long *ProgramCounter,
unsigned long *FramePointer)
573 Report(isFatal,
"UBSan: Undefined Behavior in %s, control flow integrity check for type %s failed during %s (vtable address %#lx)\n",
576 Report(isFatal || FromUnrecoverableHandler,
"UBSan: Undefined Behavior in %s, control flow integrity check for type %s failed during %s (vtable address %#lx; %s vtable; from %s handler; Program Counter %#lx; Frame Pointer %#lx)\n",
603 Report(isFatal,
"UBSan: Undefined Behavior in %s, %s address %#lx which might not point to an object of type %s\n"
622 Report(isFatal,
"UBSan: Undefined Behavior in %s, %s (of type %s) is outside the range of representable values of type %s\n",
638 Report(isFatal,
"UBSan: Undefined Behavior in %s, execution reached the end of a value-returning function without returning a value\n",
657 szAttributeLocation[0] =
'\0';
659 Report(isFatal,
"UBSan: Undefined Behavior in %s, null pointer passed as argument %d, which is declared to never be null%s%s\n",
679 szAttributeLocation[0] =
'\0';
681 Report(isFatal,
"UBSan: Undefined Behavior in %s, null pointer returned from function declared to never return null%s%s\n",
697 Report(isFatal,
"UBSan: Undefined Behavior in %s, pointer expression with base %#lx overflowed to %#lx\n",
698 szLocation, ulBase, ulResult);
706 unsigned long ulRealPointer;
715 ulRealPointer = ulPointer - ulOffset;
720 Report(isFatal,
"UBSan: Undefined Behavior in %s, alignment assumption of %#lx for pointer %#lx (offset %#lx), assumption made in %s\n",
721 szLocation, ulAlignment, ulRealPointer, ulOffset,
722 szAssumptionLocation);
724 Report(isFatal,
"UBSan: Undefined Behavior in %s, alignment assumption of %#lx for pointer %#lx (offset %#lx)\n",
725 szLocation, ulAlignment, ulRealPointer, ulOffset);
781 HandleCFIBadType(
false, pData, ulVtable, &bValidVtable, &FromUnrecoverableHandler, &ProgramCounter, &FramePointer);
1016 ASSERT(pLocationPointer);
1026 ASSERT(pLocationPointer);
1158__ubsan_get_current_report_data(
const char **ppOutIssueKind,
const char **ppOutMessage,
const char **ppOutFilename, uint32_t *pOutLine, uint32_t *pOutCol,
char **ppOutMemoryAddr)
1183Report(
bool isFatal,
const char *pFormat, ...)
1189 va_start(ap, pFormat);
1196 if (ubsan_flags == -1) {
1200 ubsan_flags = UBSAN_STDERR;
1202 if (getenv_r(
"LIBC_UBSAN",
buf,
sizeof(
buf)) != -1) {
1203 for (p =
buf; *p; p++) {
1206 SET(ubsan_flags, UBSAN_ABORT);
1209 CLR(ubsan_flags, UBSAN_ABORT);
1212 SET(ubsan_flags, UBSAN_STDERR);
1215 CLR(ubsan_flags, UBSAN_STDERR);
1218 SET(ubsan_flags, UBSAN_SYSLOG);
1221 CLR(ubsan_flags, UBSAN_SYSLOG);
1224 SET(ubsan_flags, UBSAN_STDOUT);
1227 CLR(ubsan_flags, UBSAN_STDOUT);
1238 if (
ISSET(ubsan_flags, UBSAN_STDOUT)) {
1245 if (
ISSET(ubsan_flags, UBSAN_STDERR)) {
1248 vfprintf(stderr, pFormat, tmp);
1252 if (
ISSET(ubsan_flags, UBSAN_SYSLOG)) {
1255 struct syslog_data SyslogData = SYSLOG_DATA_INIT;
1256 ubsan_vsyslog(LOG_DEBUG | LOG_USER, &SyslogData, pFormat, tmp);
1259 if (isFatal ||
ISSET(ubsan_flags, UBSAN_ABORT)) {
1275 uint32_t siOldValue;
1276 volatile uint32_t *pLine;
1280 pLine = &pLocation->
mLine;
1283 siOldValue = *pLine;
1284 }
while (__sync_val_compare_and_swap(pLine, siOldValue, siOldValue |
ACK_REPORTED) != siOldValue);
1304 Report(
true,
"UBSan: Unknown variable type %#04" PRIx16
"\n", pType->
mTypeKind);
1324#ifdef __SIZEOF_INT128__
1326DeserializeUINT128(
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType, __uint128_t U128)
1332 memcpy(rgNumber, &U128,
sizeof(U128));
1334 strlcpy(pBuffer,
"Undecoded-128-bit-Integer-Type (0x", zBUfferLength);
1335#if BYTE_ORDER == LITTLE_ENDIAN
1336 for (zI =
sizeof(
ulongest) - 1; zI >= 0; zI--) {
1338 for (zI = 0; zI < (ssize_t)
sizeof(
ulongest); zI++) {
1340 snprintf(szBuf,
sizeof(szBuf),
"%02" PRIx8, rgNumber[zI]);
1341 strlcat(pBuffer, szBuf, zBUfferLength);
1343 strlcat(pBuffer,
")", zBUfferLength);
1352 ASSERT(zBUfferLength > 0);
1358 ASSERT(0 &&
"Invalid codepath");
1360#ifdef __SIZEOF_INT128__
1362 DeserializeUINT128(pBuffer, zBUfferLength, pType,
STATIC_CAST(__uint128_t, L));
1379 ASSERT(zBUfferLength > 0);
1385 ASSERT(0 &&
"Invalid codepath");
1387#ifdef __SIZEOF_INT128__
1389 DeserializeUINT128(pBuffer, zBUfferLength, pType,
STATIC_CAST(__uint128_t, L));
1403DeserializeFloatOverPointer(
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType,
unsigned long *pNumber)
1406#ifdef __HAVE_LONG_DOUBLE
1411 ASSERT(zBUfferLength > 0);
1418 ASSERT(
sizeof(D) ==
sizeof(uint64_t));
1419#ifdef __HAVE_LONG_DOUBLE
1420 ASSERT(
sizeof(LD) >
sizeof(uint64_t));
1424#ifdef __HAVE_LONG_DOUBLE
1428 memcpy(&LD, pNumber,
sizeof(
long double));
1429 snprintf(pBuffer, zBUfferLength,
"%Lg", LD);
1433 memcpy(&D, pNumber,
sizeof(
double));
1434 snprintf(pBuffer, zBUfferLength,
"%g", D);
1440DeserializeFloatInlined(
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType,
unsigned long ulNumber)
1447 ASSERT(zBUfferLength > 0);
1449 ASSERT(
sizeof(
F) ==
sizeof(uint32_t));
1450 ASSERT(
sizeof(D) ==
sizeof(uint64_t));
1454 memcpy(&D, &ulNumber,
sizeof(
double));
1455 snprintf(pBuffer, zBUfferLength,
"%g", D);
1464 memcpy(&
F, &U32,
sizeof(
float));
1465 snprintf(pBuffer, zBUfferLength,
"%g",
F);
1468 snprintf(pBuffer, zBUfferLength,
"Undecoded-16-bit-Floating-Type (%#04" PRIx16
")",
STATIC_CAST(uint16_t, ulNumber));
1477 size_t zNumberWidth;
1484 switch (zNumberWidth) {
1486 Report(
true,
"UBSan: Unexpected %zu-Bit Type in %s\n", zNumberWidth, szLocation);
1489#ifdef __SIZEOF_INT128__
1492 Report(
true,
"UBSan: Unexpected 128-Bit Type in %s\n", szLocation);
1497 if (
sizeof(ulNumber) * CHAR_BIT <
WIDTH_64) {
1520 size_t zNumberWidth;
1526 switch (zNumberWidth) {
1528 Report(
true,
"UBSan: Unexpected %zu-Bit Type in %s\n", zNumberWidth, szLocation);
1531#ifdef __SIZEOF_INT128__
1535 Report(
true,
"UBSan: Unexpected 128-Bit Type in %s\n", szLocation);
1539 if (
sizeof(ulNumber) * CHAR_BIT <
WIDTH_64) {
1558DeserializeNumberFloat(
char *szLocation,
char *pBuffer,
size_t zBUfferLength,
struct CTypeDescriptor *pType,
unsigned long ulNumber)
1560 size_t zNumberWidth;
1564 ASSERT(zBUfferLength > 0);
1569 switch (zNumberWidth) {
1571 Report(
true,
"UBSan: Unexpected %zu-Bit Type in %s\n", zNumberWidth, szLocation);
1573#ifdef __HAVE_LONG_DOUBLE
1577 DeserializeFloatOverPointer(pBuffer, zBUfferLength, pType,
REINTERPRET_CAST(
unsigned long *, ulNumber));
1581 if (
sizeof(ulNumber) * CHAR_BIT <
WIDTH_64) {
1582 DeserializeFloatOverPointer(pBuffer, zBUfferLength, pType,
REINTERPRET_CAST(
unsigned long *, ulNumber));
1587 DeserializeFloatInlined(pBuffer, zBUfferLength, pType, ulNumber);
1599 ASSERT(zBUfferLength > 0);
1614 Report(
true,
"UBSan: Unexpected Float Type in %s\n", szLocation);
1617 DeserializeNumberFloat(szLocation, pBuffer, zBUfferLength, pType, ulNumber);
1621 Report(
true,
"UBSan: Unknown Type in %s\n", szLocation);
1630 const char *rgczTypeCheckKinds[] = {
1633 "reference binding to",
1634 "member access within",
1636 "constructor call on",
1640 "cast to virtual base of",
1641 "_Nonnull binding to",
1642 "dynamic operation on"
1647 return rgczTypeCheckKinds[hhuTypeCheckKind];
1653 const char *rgczBuiltinCheckKinds[] = {
1660 return rgczBuiltinCheckKinds[hhuBuiltinCheckKind];
1666 const char *rgczCFICheckKinds[] = {
1669 "base-to-derived cast",
1670 "cast to unrelated type",
1671 "indirect function call",
1672 "non-virtual pointer to member function call",
1673 "virtual pointer to member function call",
1678 return rgczCFICheckKinds[hhuCFICheckKind];
1703 return llluGetNumber(szLocation, pType, ulNumber) >= zWidth;
void vpanic(const char *fmt, va_list ap)
void __ubsan_handle_float_cast_overflow(struct CFloatCastOverflowData *pData, unsigned long ulFrom)
void __ubsan_handle_type_mismatch(struct CTypeMismatchData *pData, unsigned long ulPointer)
static void HandleCFIBadType(bool isFatal, struct CCFICheckFailData *pData, unsigned long ulVtable, bool *bValidVtable, bool *FromUnrecoverableHandler, unsigned long *ProgramCounter, unsigned long *FramePointer)
static void HandleMissingReturn(bool isFatal, struct CUnreachableData *pData)
void __ubsan_handle_mul_overflow(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
static bool isNegativeNumber(char *szLocation, struct CTypeDescriptor *pType, unsigned long ulNumber)
void __ubsan_handle_type_mismatch_v1(struct CTypeMismatchData_v1 *pData, unsigned long ulPointer)
void __ubsan_handle_sub_overflow_abort(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
void __ubsan_handle_mul_overflow_abort(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
static void Report(bool isFatal, const char *pFormat,...) __printflike(2
static void HandleAlignmentAssumption(bool isFatal, struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset)
void __ubsan_handle_out_of_bounds_abort(struct COutOfBoundsData *pData, unsigned long ulIndex)
void __ubsan_handle_nonnull_arg(struct CNonNullArgData *pData)
static void DeserializeNumberSigned(char *pBuffer, size_t zBUfferLength, struct CTypeDescriptor *pType, longest L)
void __ubsan_handle_pointer_overflow_abort(struct CPointerOverflowData *pData, unsigned long ulBase, unsigned long ulResult)
void __ubsan_handle_missing_return(struct CUnreachableData *pData)
static void HandleFloatCastOverflow(bool isFatal, struct CFloatCastOverflowData *pData, unsigned long ulFrom)
void __ubsan_handle_function_type_mismatch_abort(struct CFunctionTypeMismatchData *pData, unsigned long ulFunction)
void __ubsan_handle_function_type_mismatch(struct CFunctionTypeMismatchData *pData, unsigned long ulFunction)
void __ubsan_handle_load_invalid_value_abort(struct CInvalidValueData *pData, unsigned long ulVal)
void __ubsan_handle_dynamic_type_cache_miss(struct CDynamicTypeCacheMissData *pData, unsigned long ulPointer, unsigned long ulHash)
void __ubsan_handle_alignment_assumption(struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset)
void __ubsan_handle_negate_overflow_abort(struct COverflowData *pData, unsigned long ulOldVal)
static const char * DeserializeCFICheckKind(uint8_t hhuCFICheckKind)
#define STATIC_CAST(__dt, __st)
void __ubsan_handle_vla_bound_not_positive_abort(struct CVLABoundData *pData, unsigned long ulBound)
void __ubsan_handle_cfi_check_fail_abort(struct CCFICheckFailData *pData, unsigned long ulValue, unsigned long ulValidVtable)
void __ubsan_handle_vla_bound_not_positive(struct CVLABoundData *pData, unsigned long ulBound)
void __ubsan_handle_shift_out_of_bounds(struct CShiftOutOfBoundsData *pData, unsigned long ulLHS, unsigned long ulRHS)
void __ubsan_handle_nonnull_return_v1(struct CNonNullReturnData *pData, struct CSourceLocation *pLocationPointer)
void __ubsan_handle_add_overflow_abort(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
intptr_t __ubsan_vptr_type_cache[128]
void __ubsan_handle_float_cast_overflow_abort(struct CFloatCastOverflowData *pData, unsigned long ulFrom)
static void DeserializeNumber(char *szLocation, char *pBuffer, size_t zBUfferLength, struct CTypeDescriptor *pType, unsigned long ulNumber)
void __ubsan_handle_divrem_overflow_abort(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
static void HandleNonnullArg(bool isFatal, struct CNonNullArgData *pData)
void __ubsan_handle_sub_overflow(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
void __ubsan_handle_pointer_overflow(struct CPointerOverflowData *pData, unsigned long ulBase, unsigned long ulResult)
static void HandleDynamicTypeCacheMiss(bool isFatal, struct CDynamicTypeCacheMissData *pData, unsigned long ulPointer, unsigned long ulHash)
static void HandleNegateOverflow(bool isFatal, struct COverflowData *pData, unsigned long ulOldValue)
static void HandleLoadInvalidValue(bool isFatal, struct CInvalidValueData *pData, unsigned long ulValue)
void __ubsan_handle_dynamic_type_cache_miss_abort(struct CDynamicTypeCacheMissData *pData, unsigned long ulPointer, unsigned long ulHash)
void __ubsan_handle_nullability_arg_abort(struct CNonNullArgData *pData)
static void HandleInvalidBuiltin(bool isFatal, struct CInvalidBuiltinData *pData)
void __ubsan_handle_invalid_builtin_abort(struct CInvalidBuiltinData *pData)
static void HandleTypeMismatch(bool isFatal, struct CSourceLocation *mLocation, struct CTypeDescriptor *mType, unsigned long mLogAlignment, uint8_t mTypeCheckKind, unsigned long ulPointer)
static void DeserializeLocation(char *pBuffer, size_t zBUfferLength, struct CSourceLocation *pLocation)
void __ubsan_handle_builtin_unreachable(struct CUnreachableData *pData)
static longest llliGetNumber(char *szLocation, struct CTypeDescriptor *pType, unsigned long ulNumber)
static void HandleBuiltinUnreachable(bool isFatal, struct CUnreachableData *pData)
void __ubsan_handle_alignment_assumption_abort(struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset)
static void HandlePointerOverflow(bool isFatal, struct CPointerOverflowData *pData, unsigned long ulBase, unsigned long ulResult)
static void HandleOutOfBounds(bool isFatal, struct COutOfBoundsData *pData, unsigned long ulIndex)
static void DeserializeNumberUnsigned(char *pBuffer, size_t zBUfferLength, struct CTypeDescriptor *pType, ulongest L)
static void HandleNonnullReturn(bool isFatal, struct CNonNullReturnData *pData, struct CSourceLocation *pLocationPointer)
void __ubsan_handle_load_invalid_value(struct CInvalidValueData *pData, unsigned long ulVal)
static void HandleShiftOutOfBounds(bool isFatal, struct CShiftOutOfBoundsData *pData, unsigned long ulLHS, unsigned long ulRHS)
void __ubsan_handle_add_overflow(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
static void HandleFunctionTypeMismatch(bool isFatal, struct CFunctionTypeMismatchData *pData, unsigned long ulFunction)
void __ubsan_handle_nonnull_arg_abort(struct CNonNullArgData *pData)
void __ubsan_handle_nullability_return_v1(struct CNonNullReturnData *pData, struct CSourceLocation *pLocationPointer)
void __ubsan_handle_invalid_builtin(struct CInvalidBuiltinData *pData)
void __ubsan_handle_type_mismatch_v1_abort(struct CTypeMismatchData_v1 *pData, unsigned long ulPointer)
void __ubsan_handle_nullability_return_v1_abort(struct CNonNullReturnData *pData, struct CSourceLocation *pLocationPointer)
void __ubsan_handle_negate_overflow(struct COverflowData *pData, unsigned long ulOldVal)
void __ubsan_handle_nonnull_return_v1_abort(struct CNonNullReturnData *pData, struct CSourceLocation *pLocationPointer)
static size_t zDeserializeTypeWidth(struct CTypeDescriptor *pType)
static const char * DeserializeBuiltinCheckKind(uint8_t hhuBuiltinCheckKind)
static void static bool isAlreadyReported(struct CSourceLocation *pLocation)
void __ubsan_handle_type_mismatch_abort(struct CTypeMismatchData *pData, unsigned long ulPointer)
void __ubsan_handle_cfi_bad_type(struct CCFICheckFailData *pData, unsigned long ulVtable, bool bValidVtable, bool FromUnrecoverableHandler, unsigned long ProgramCounter, unsigned long FramePointer)
static bool isShiftExponentTooLarge(char *szLocation, struct CTypeDescriptor *pType, unsigned long ulNumber, size_t zWidth)
#define NUMBER_SIGNED_BIT
void __ubsan_get_current_report_data(const char **ppOutIssueKind, const char **ppOutMessage, const char **ppOutFilename, uint32_t *pOutLine, uint32_t *pOutCol, char **ppOutMemoryAddr)
void __ubsan_handle_divrem_overflow(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS)
#define REINTERPRET_CAST(__dt, __st)
static ulongest llluGetNumber(char *szLocation, struct CTypeDescriptor *pType, unsigned long ulNumber)
static void HandleVlaBoundNotPositive(bool isFatal, struct CVLABoundData *pData, unsigned long ulBound)
void __ubsan_handle_nullability_arg(struct CNonNullArgData *pData)
static void HandleOverflow(bool isFatal, struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS, const char *szOperation)
static const char * DeserializeTypeCheckKind(uint8_t hhuTypeCheckKind)
void __ubsan_handle_out_of_bounds(struct COutOfBoundsData *pData, unsigned long ulIndex)
void __ubsan_handle_cfi_check_fail(struct CCFICheckFailData *pData, unsigned long ulValue, unsigned long ulValidVtable)
#define __SHIFTOUT(__x, __mask)
void __ubsan_handle_shift_out_of_bounds_abort(struct CShiftOutOfBoundsData *pData, unsigned long ulLHS, unsigned long ulRHS)
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
struct CSourceLocation mAssumptionLocation
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
struct CTypeDescriptor * mType
struct CSourceLocation mLocation
struct CSourceLocation mLocation
struct CTypeDescriptor * mToType
struct CTypeDescriptor * mFromType
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
struct CSourceLocation mLocation
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
struct CSourceLocation mLocation
struct CSourceLocation mAttributeLocation
struct CSourceLocation mAttributeLocation
struct CSourceLocation mLocation
struct CTypeDescriptor * mArrayType
struct CTypeDescriptor * mIndexType
struct CTypeDescriptor * mType
struct CSourceLocation mLocation
struct CSourceLocation mLocation
struct CTypeDescriptor * mRHSType
struct CTypeDescriptor * mLHSType
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
unsigned long mLogAlignment
struct CSourceLocation mLocation
struct CSourceLocation mLocation
struct CTypeDescriptor * mType
struct CSourceLocation mLocation
int vprintf(const char *fmt, va_list ap)
int snprintf(char *str, size_t size, const char *format,...)