Max OS 0.3
Loading...
Searching...
No Matches
ubsan.h File Reference

Defines structures and a handler for Undefined Behavior Sanitizer (UBSan) runtime errors. More...

#include <cstdint>

Go to the source code of this file.

Classes

struct  MaxOS::runtime::SourceLocation
 The location in the source code where the undefined behaviour occurred. More...
 
struct  MaxOS::runtime::TypeDescriptor
 Describes a type in the program. More...
 
struct  MaxOS::runtime::TypeMismatchInfo
 Information about a type mismatch error. More...
 
struct  MaxOS::runtime::TypeMismatchInfoV1
 Information about a type mismatch error (version 1) More...
 
struct  MaxOS::runtime::OverflowInfo
 Information about an overflow error. More...
 
struct  MaxOS::runtime::ShiftOutOfBoundsInfo
 Information about a shift out of bounds error. More...
 
struct  MaxOS::runtime::OutOfBoundsInfo
 Information about an out of bounds error. More...
 
struct  MaxOS::runtime::LocationOnlyInfo
 Information that an error that only has a location. More...
 
struct  MaxOS::runtime::InvaildValueInfo
 Information about an invalid value error. More...
 
struct  MaxOS::runtime::VLABoundNotPositiveInfo
 Information about a VLA bound not positive error. More...
 
class  MaxOS::runtime::UBSanHandler
 Handles undefined behaviour sanitizer runtime errors. More...
 

Macros

#define ubsan_aligned(value, alignment)   !(value & (alignment - 1))
 Check if a value is aligned to the given alignment.
 

Typedefs

typedef struct MaxOS::runtime::SourceLocation MaxOS::runtime::source_location_t
 Alias for SourceLocation struct.
 
typedef struct MaxOS::runtime::TypeDescriptor MaxOS::runtime::type_descriptor_t
 Alias for TypeDescriptor struct.
 
typedef struct MaxOS::runtime::TypeMismatchInfo MaxOS::runtime::type_mismatch_info_t
 Alias for TypeMismatchInfo struct.
 
typedef struct MaxOS::runtime::TypeMismatchInfoV1 MaxOS::runtime::type_mismatch_info_v1_t
 Alias for TypeMismatchInfoV1 struct.
 
typedef struct MaxOS::runtime::OverflowInfo MaxOS::runtime::overflow_info_t
 Alias for OverflowInfo struct.
 
typedef struct MaxOS::runtime::ShiftOutOfBoundsInfo MaxOS::runtime::shift_out_of_bounds_info_t
 Alias for ShiftOutOfBoundsInfo struct.
 
typedef struct MaxOS::runtime::OutOfBoundsInfo MaxOS::runtime::out_of_bounds_info_t
 Alias for OutOfBoundsInfo struct.
 
typedef struct MaxOS::runtime::LocationOnlyInfo MaxOS::runtime::location_only_info_t
 Alias for LocationOnlyInfo struct.
 
typedef struct MaxOS::runtime::InvaildValueInfo MaxOS::runtime::invalid_value_info_t
 Alias for InvaildValueInfo struct.
 
typedef struct MaxOS::runtime::VLABoundNotPositiveInfo MaxOS::runtime::vla_bound_not_positive_info_t
 Alias for VLABoundNotPositiveInfo struct.
 

Variables

const char * MaxOS::runtime::TYPE_CHECK_KINDS []
 List of type check errors.
 

Detailed Description

Defines structures and a handler for Undefined Behavior Sanitizer (UBSan) runtime errors.

Date
30th December 2024
Author
Max Tyson

Definition in file ubsan.h.

Macro Definition Documentation

◆ ubsan_aligned

#define ubsan_aligned (   value,
  alignment 
)    !(value & (alignment - 1))

Check if a value is aligned to the given alignment.

Definition at line 15 of file ubsan.h.

Variable Documentation

◆ TYPE_CHECK_KINDS

const char* MaxOS::runtime::TYPE_CHECK_KINDS[]
Initial value:
= {
"load of",
"store to",
"reference binding to",
"member access within",
"member call on",
"constructor call on",
"downcast of",
"downcast of",
"upcast of",
"cast to virtual base of",
}

List of type check errors.

Definition at line 167 of file ubsan.h.

167 {
168 "load of",
169 "store to",
170 "reference binding to",
171 "member access within",
172 "member call on",
173 "constructor call on",
174 "downcast of",
175 "downcast of",
176 "upcast of",
177 "cast to virtual base of",
178 };

Referenced by MaxOS::runtime::UBSanHandler::print_type_mismatch(), and MaxOS::runtime::UBSanHandler::print_type_mismatch_v1().