Luna/libluna/include/luna/UBSAN.h

81 lines
1.5 KiB
C
Raw Permalink Normal View History

#pragma once
#include <luna/Types.h>
namespace UBSAN
{
struct SourceLocation
{
const char* file;
u32 line;
u32 column;
};
struct TypeDescriptor
{
u16 kind;
u16 info;
char name[];
};
namespace UBInfo
{
struct TypeMismatchInfo
{
SourceLocation location;
TypeDescriptor* type;
usize alignment;
u8 type_check_kind;
};
struct TypeMismatchInfo_v1
{
SourceLocation location;
TypeDescriptor* type;
u8 log_alignment;
u8 type_check_kind;
};
struct OverflowInfo
{
SourceLocation location;
TypeDescriptor* type;
};
struct UnreachableInfo
{
SourceLocation location;
};
struct OutOfBoundsInfo
{
SourceLocation location;
TypeDescriptor* array_type;
TypeDescriptor* index_type;
};
struct InvalidValueInfo
{
SourceLocation location;
TypeDescriptor* type;
};
struct ShiftOutOfBoundsInfo
{
SourceLocation location;
TypeDescriptor* lhs_type;
TypeDescriptor* rhs_type;
};
struct PointerOverflowInfo
{
SourceLocation location;
};
2023-04-07 09:53:19 +00:00
struct NonnullArgInfo
{
SourceLocation location;
SourceLocation attr_location;
};
}
}