LOG_FATAL
- Macro
- April 17, 2026
Table of Contents
LOG_FATAL
LOG_FATALDescription
Writes a fatal log message and aborts the program. …[in] : Format string and arguments following printf-style syntax.
Success
Message logged and program aborted via abort()
Failure
Logging may fail silently, but abort() will still execute
Usage example (Cross-references)
- In
Memory.c:13:
i32 MemCompare(const void *p1, const void *p2, size n) {
if (!p1 || !p2) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:30:
void *MemCopy(void *dst, const void *src, size n) {
if (!dst || !src) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:43:
void *MemMove(void *dst, const void *src, size n) {
if (!dst || !src) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:64:
void *MemSet(void *dst, i32 val, size n) {
if (!dst) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:76:
size ZstrLen(const char *str) {
if (!str) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:87:
i32 ZstrCompare(const char *s1, const char *s2) {
if (!s1 || !s2) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:99:
i32 ZstrCompareN(const char *s1, const char *s2, size n) {
if (!s1 || !s2) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:122:
char *ZstrDupN(const char *src, size n) {
if (!src) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:145:
bool ZstrInitClone(const char **dst, const char **src) {
if (!dst || !src || !*src) {
LOG_FATAL("Invalid arguments.");
}
- In
Memory.c:154:
void ZstrDeinit(const char **zs) {
if (!zs) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:163:
char *ZstrFindSubstring(const char *haystack, const char *needle) {
if (!haystack || !needle) {
LOG_FATAL("Invalid arguments");
}
- In
Memory.c:188:
char *ZstrFindSubstringN(const char *haystack, const char *needle, size needle_len) {
if (!haystack || !needle) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:92:
static bool ParseFormatSpec(const char *spec, u32 len, FmtInfo *fi) {
if (!spec || !fi) {
LOG_FATAL("Invalid arguments to ParseFormatSpec");
return false;
}
- In
Io.c:244:
bool StrWriteFmtInternal(Str *o, const char *fmt, TypeSpecificIO *args, u64 argc) {
if (!o || !fmt) {
LOG_FATAL("Invalid arguments");
return false;
}
- In
Io.c:304:
}
#else
LOG_FATAL("Invalid writer or data pointer");
#endif
}
- In
Io.c:422:
const char *StrReadFmtInternal(const char *input, const char *fmtstr, TypeSpecificIO *argv, u64 argc) {
if (!input || !fmtstr) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:647:
void FReadFmtInternal(FILE *file, const char *fmtstr, TypeSpecificIO *argv, u64 argc) {
if (!file || !fmtstr) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:709:
static inline void write_int_as_chars(Str *o, FormatFlags flags, u64 value, size num_bytes) {
if (!o || !num_bytes || num_bytes > 8) {
LOG_FATAL("Invalid arguments to write_int_as_chars");
}
- In
Io.c:744:
static inline void write_char_internal(Str *o, FormatFlags flags, const char *vs, size len) {
if (!o || !vs || !len) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:819:
if (!out) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:953:
if (!input) {
LOG_FATAL("input is NULL");
}
- In
Io.c:1011:
static inline const char *read_chars_internal(const char *i, u8 *buffer, size buffer_size, FmtInfo *fmt_info) {
if (!i || !buffer || !buffer_size) {
LOG_FATAL("Invalid arguments to read_chars_internal");
}
- In
Io.c:1063:
void _write_Str(Str *o, FmtInfo *fmt_info, Str *s) {
if (!o || !s || !fmt_info) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:1131:
void _write_Zstr(Str *o, FmtInfo *fmt_info, const char **s) {
if (!o || !s || !*s || !fmt_info) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1204:
void _write_u64(Str *o, FmtInfo *fmt_info, u64 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1248:
void _write_u32(Str *o, FmtInfo *fmt_info, u32 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1264:
void _write_u16(Str *o, FmtInfo *fmt_info, u16 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1280:
void _write_u8(Str *o, FmtInfo *fmt_info, u8 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1296:
void _write_i64(Str *o, FmtInfo *fmt_info, i64 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1340:
void _write_i32(Str *o, FmtInfo *fmt_info, i32 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1356:
void _write_i16(Str *o, FmtInfo *fmt_info, i16 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1372:
void _write_i8(Str *o, FmtInfo *fmt_info, i8 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1388:
void _write_f64(Str *o, FmtInfo *fmt_info, f64 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1451:
void _write_f32(Str *o, FmtInfo *fmt_info, f32 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1473:
if (!o || !fmt_info || !value) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:1481:
if (FloatFmtUsesUnsupportedFlags(fmt_info)) {
LOG_FATAL("Float only supports decimal and scientific formatting");
}
- In
Io.c:1575:
const char *_read_Str(const char *i, FmtInfo *fmt_info, Str *s) {
if (!i || !s)
LOG_FATAL("Invalid arguments");
ValidateStr(s);
- In
Io.c:1841:
const char *_read_f64(const char *i, FmtInfo *fmt_info, f64 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:1949:
const char *_read_u8(const char *i, FmtInfo *fmt_info, u8 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Skip whitespace
- In
Io.c:2022:
const char *_read_u16(const char *i, FmtInfo *fmt_info, u16 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2097:
const char *_read_u32(const char *i, FmtInfo *fmt_info, u32 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2171:
const char *_read_u64(const char *i, FmtInfo *fmt_info, u64 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2237:
const char *_read_i8(const char *i, FmtInfo *fmt_info, i8 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2311:
const char *_read_i16(const char *i, FmtInfo *fmt_info, i16 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2386:
const char *_read_i32(const char *i, FmtInfo *fmt_info, i32 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2461:
const char *_read_i64(const char *i, FmtInfo *fmt_info, i64 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:2528:
(void)fmt_info; // Unused parameter
if (!i || !out)
LOG_FATAL("Invalid arguments");
// For string types, :c has no effect - work like regular string reading
- In
Io.c:2559:
void _write_BitVec(Str *o, FmtInfo *fmt_info, BitVec *bv) {
if (!o || !fmt_info || !bv) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:2608:
void _write_Int(Str *o, FmtInfo *fmt_info, Int *value) {
if (!o || !fmt_info || !value) {
LOG_FATAL("Invalid arguments");
return;
}
- In
Io.c:2625:
if (!buffer) {
LOG_FATAL("Failed to allocate buffer for Int character formatting");
}
- In
Io.c:2657:
(void)fmt_info;
(void)s;
LOG_FATAL("Attempt to write unsupported type");
}
- In
Io.c:2663:
(void)fmt_info; // Unused parameter
if (!i || !bv) {
LOG_FATAL("Invalid arguments");
return i;
}
- In
Io.c:2778:
const char *_read_Int(const char *i, FmtInfo *fmt_info, Int *value) {
if (!i || !value) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2850:
if (!i || !value) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:2890:
(void)fmt_info; // Unused parameter
(void)s;
LOG_FATAL("Attempt to read unsupported type.");
return i;
}
- In
Io.c:2896:
const char *_read_f32(const char *i, FmtInfo *fmt_info, f32 *v) {
if (!i || !v)
LOG_FATAL("Invalid arguments");
// Handle character format specifier
- In
Io.c:3008:
static void _write_r8(Str *o, FmtInfo *fmt_info, u8 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:3016:
static void _write_r16(Str *o, FmtInfo *fmt_info, u16 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:3038:
case ENDIAN_NATIVE :
default : {
LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
}
}
- In
Io.c:3045:
static void _write_r32(Str *o, FmtInfo *fmt_info, u32 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:3072:
case ENDIAN_NATIVE :
default : {
LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
}
}
- In
Io.c:3080:
static void _write_r64(Str *o, FmtInfo *fmt_info, u64 *v) {
if (!o || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:3114:
case ENDIAN_NATIVE :
default : {
LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
}
}
- In
Io.c:3121:
static const char *_read_r8(const char *i, FmtInfo *fmt_info, u8 *v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments");
}
- In
Io.c:3133:
static const char *_read_r16(const char *i, FmtInfo *fmt_info, u16 *v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments to _read_r16");
}
- In
Io.c:3153:
case ENDIAN_NATIVE :
default :
LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r16.");
}
- In
Io.c:3163:
static const char *_read_r32(const char *i, FmtInfo *fmt_info, u32 *v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments to _read_r32");
}
- In
Io.c:3182:
case ENDIAN_NATIVE :
default :
LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r32.");
}
- In
Io.c:3192:
static const char *_read_r64(const char *i, FmtInfo *fmt_info, u64 *v) {
if (!i || !fmt_info || !v) {
LOG_FATAL("Invalid arguments to _read_r64");
}
- In
Io.c:3213:
case ENDIAN_NATIVE :
default :
LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r64.");
}
- In
Vec.c:24:
if (!v->alignment) {
LOG_FATAL("Invalid alignment. Did you initialize before use? Aborting...");
}
- In
Vec.c:151:
if (idx > vec->length) {
LOG_FATAL("vector index out of bounds, insertion at index greater than length");
}
- In
Vec.c:189:
if (idx > vec->length) {
LOG_FATAL("vector index out of bounds, insertion at index greater than length");
}
- In
Vec.c:225:
if (start + count > vec->length) {
LOG_FATAL("vector range out of bounds.");
}
- In
Vec.c:266:
if (start + count > vec->length) {
LOG_FATAL("vector range out of bounds.");
}
- In
Vec.c:320:
if (vec_aligned_size(vec, item_size) != item_size) {
LOG_FATAL(
"QSort not implemented for vectors wherein the size of items don't "
"match their aligned size."
- In
Vec.c:334:
if (idx1 >= vec->length || idx2 >= vec->length) {
LOG_FATAL("vector index out of bounds.");
}
- In
Vec.c:381:
void validate_vec(const GenericVec *v) {
if (!(v)) {
LOG_FATAL("NULL vec object pointer.");
}
if ((v)->__magic != MISRA_VEC_MAGIC) {
- In
Vec.c:384:
}
if ((v)->__magic != MISRA_VEC_MAGIC) {
LOG_FATAL("Invalid vec object. Either uninitialized or corrupted!");
}
if (!(v)->alignment || (v)->length > (v)->capacity) {
- In
Vec.c:387:
}
if (!(v)->alignment || (v)->length > (v)->capacity) {
LOG_FATAL("Invalid vec object.");
}
// if memory is invalid, system will segfault here
- In
Float.c:29:
static i64 float_add_i64_checked(i64 a, i64 b) {
if ((b > 0 && a > INT64_MAX - b) || (b < 0 && a < INT64_MIN - b)) {
LOG_FATAL("Float exponent overflow");
}
- In
Float.c:37:
static i64 float_sub_i64_checked(i64 a, i64 b) {
if ((b > 0 && a < INT64_MIN + b) || (b < 0 && a > INT64_MAX + b)) {
LOG_FATAL("Float exponent overflow");
}
- In
Float.c:48:
if (len < 0 || len >= (int)sizeof(text)) {
LOG_FATAL("Failed to convert f32 to Float");
}
- In
Float.c:59:
if (len < 0 || len >= (int)sizeof(text)) {
LOG_FATAL("Failed to convert f64 to Float");
}
- In
Float.c:87:
}
if (target_exponent > value->exponent) {
LOG_FATAL("target exponent must not exceed current exponent");
}
if (target_exponent == value->exponent) {
- In
Float.c:266:
if (!text) {
LOG_FATAL("text is NULL");
}
- In
Float.c:288:
if (ch == '.') {
if (saw_decimal) {
LOG_FATAL("Invalid Float format");
}
- In
Float.c:301:
pos++;
if (text[pos] == '\0') {
LOG_FATAL("Invalid Float exponent");
}
- In
Float.c:307:
parsed = strtoll(text + pos, &endptr, 10);
if (errno == ERANGE || endptr == text + pos || *endptr != '\0') {
LOG_FATAL("Invalid Float exponent");
}
- In
Float.c:315:
}
LOG_FATAL("Invalid Float format");
}
- In
Float.c:319:
if (!saw_digit) {
LOG_FATAL("Invalid Float format");
}
- In
Float.c:632:
if (FloatIsZero(b)) {
LOG_FATAL("Division by zero");
}
if (FloatIsZero(a)) {
- In
List.c:24:
void insert_into_list(GenericList *list, void *item_data, u64 item_size, u64 idx) {
if (!list || !item_size || !item_data) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:81:
}
} else {
LOG_FATAL("list index out of range.");
}
- In
List.c:89:
void remove_range_list(GenericList *list, void *removed_data, u64 item_size, u64 start, u64 count) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:99:
if (start + count > list->length) {
LOG_FATAL("List range out of bounds.");
}
- In
List.c:156:
void qsort_list(GenericList *list, u64 item_size, GenericCompare comp) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:172:
void swap_list(GenericList *list, u64 item_size, u64 idx1, u64 idx2) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:179:
GenericListNode *n1 = node_at_list(list, item_size, idx1);
if (!n1) {
LOG_FATAL("failed to get node at specified index");
}
- In
List.c:184:
GenericListNode *n2 = node_at_list(list, item_size, idx2);
if (!n2) {
LOG_FATAL("failed to get node at specified index");
}
- In
List.c:201:
void reverse_list(GenericList *list, u64 item_size) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:215:
void push_arr_list(GenericList *list, u64 item_size, void *arr, u64 count) {
if (!list || !arr || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:229:
if (!new_tail) {
LOG_FATAL("Failed to allocate memory for new node");
}
- In
List.c:235:
if (!new_tail->data) {
free(new_tail);
LOG_FATAL("Failed to allocate memory for node data");
}
- In
List.c:268:
void merge_list(GenericList *list1, u64 item_size, GenericList *list2) {
if (!list1 || !item_size || !list2) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:284:
void clear_list(GenericList *list, u64 item_size) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:295:
GenericListNode *node_at_list(GenericList *list, u64 item_size, u64 idx) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:301:
if (idx >= list->length) {
LOG_FATAL("list index out of range.");
}
- In
List.c:314:
void *item_ptr_at_list(GenericList *list, u64 item_size, u64 idx) {
if (!list || !item_size) {
LOG_FATAL("invalid arguments.");
}
- In
List.c:320:
if (idx >= list->length) {
LOG_FATAL("list index out of bounds.");
}
- In
List.c:329:
void validate_list(const GenericList *l) {
if (!(l)) {
LOG_FATAL("List pointer is NULL.");
}
if ((l)->__magic != MISRA_LIST_MAGIC) {
- In
List.c:332:
}
if ((l)->__magic != MISRA_LIST_MAGIC) {
LOG_FATAL("Invalid list. Either not initialized or corrupted!");
}
if ((l)->length > 0) {
- In
List.c:336:
if ((l)->length > 0) {
if (!(l)->head) {
LOG_FATAL("Non-empty list has NULL head.");
}
if (!(l)->tail) {
- In
List.c:339:
}
if (!(l)->tail) {
LOG_FATAL("Non-empty list has NULL tail.");
}
}
- In
List.c:346:
GenericListNode *get_node_relative_to_list_node(GenericListNode *node, i64 ridx) {
if (!node) {
LOG_FATAL("Invalid arguments");
}
- In
List.c:372:
GenericListNode *get_node_random_access(GenericList *list, GenericListNode *node, u64 nidx, i64 ridx) {
if (!list || !node) {
LOG_FATAL("Invalid arguments");
}
- In
List.c:376:
if (nidx >= list->length) {
LOG_FATAL("Node index exceeds list bounds");
}
- In
List.c:380:
if ((ridx < 0 && (u64)(-ridx) > nidx) || (ridx > 0 && nidx + (u64)ridx >= list->length)) {
LOG_FATAL("Relative node index outside of list bounds");
}
- In
Int.c:194:
static void int_validate_radix(u8 radix) {
if (radix < 2 || radix > 36) {
LOG_FATAL("radix must be between 2 and 36");
}
}
- In
Int.c:238:
digit = int_radix_digit(digits[i]);
if (digit < 0 || digit >= radix) {
LOG_FATAL("Invalid digit for radix in Int conversion");
}
- In
Int.c:259:
if (!digits) {
LOG_FATAL("digits is NULL");
}
- In
Int.c:268:
if (digit < 0 || digit >= radix) {
LOG_FATAL("Invalid digit for radix in Int conversion");
}
- In
Int.c:297:
if (IntIsZero(value)) {
LOG_FATAL("log2 undefined for zero");
}
- In
Int.c:365:
if (!IntFitsU64(value)) {
LOG_FATAL("Int value exceeds u64 range");
}
- In
Int.c:373:
Int IntFromBytesLE(const u8 *bytes, u64 len) {
if (!bytes && len != 0) {
LOG_FATAL("bytes is NULL");
}
- In
Int.c:389:
if (!bytes) {
LOG_FATAL("bytes is NULL");
}
if (max_len == 0) {
- In
Int.c:392:
}
if (max_len == 0) {
LOG_FATAL("max_len is 0");
}
- In
Int.c:423:
Int IntFromBytesBE(const u8 *bytes, u64 len) {
if (!bytes && len != 0) {
LOG_FATAL("bytes is NULL");
}
- In
Int.c:441:
if (!bytes) {
LOG_FATAL("bytes is NULL");
}
if (max_len == 0) {
- In
Int.c:444:
}
if (max_len == 0) {
LOG_FATAL("max_len is 0");
}
- In
Int.c:475:
Int IntFromStr(const char *decimal) {
if (!decimal) {
LOG_FATAL("decimal is NULL");
}
- In
Int.c:495:
if (!digits) {
LOG_FATAL("digits is NULL");
}
if (digits[0] == '+') {
- In
Int.c:538:
Int IntFromBinary(const char *binary) {
if (!binary) {
LOG_FATAL("binary is NULL");
}
- In
Int.c:557:
Int IntFromOctStr(const char *octal) {
if (!octal) {
LOG_FATAL("octal is NULL");
}
- In
Int.c:576:
Int IntFromHexStr(const char *hex) {
if (!hex) {
LOG_FATAL("hex is NULL");
}
- In
Int.c:744:
if (!IntSubU64(result, value, magnitude)) {
LOG_FATAL("IntAdd would produce a negative result");
}
}
- In
Int.c:896:
if (quotient == remainder) {
LOG_FATAL("quotient and remainder must be different objects");
}
if (IntIsZero(divisor)) {
- In
Int.c:899:
}
if (IntIsZero(divisor)) {
LOG_FATAL("Division by zero");
}
- In
Int.c:963:
if (IntIsZero(divisor)) {
LOG_FATAL("Division by zero");
}
- In
Int.c:986:
if (divisor == 0) {
LOG_FATAL("Division by zero");
}
- In
Int.c:1014:
if (modulus == 0) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1075:
if (root == remainder) {
LOG_FATAL("root and remainder must be different objects");
}
if (degree == 0) {
- In
Int.c:1078:
}
if (degree == 0) {
LOG_FATAL("root degree is zero");
}
- In
Int.c:1234:
if (IntIsZero(n) || IntIsEven(n)) {
LOG_FATAL("n must be non-zero and odd");
}
- In
Int.c:1280:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1304:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1340:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1364:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1395:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1434:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1474:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
Int.c:1545:
if (IntIsZero(modulus)) {
LOG_FATAL("modulus is zero");
}
- In
BitVec.c:94:
if (!new_data) {
LOG_FATAL("Failed to allocate memory for bitvec");
return;
}
- In
BitVec.c:189:
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
u64 byte_idx = BIT_INDEX(idx);
- In
BitVec.c:200:
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
u64 byte_idx = BIT_INDEX(idx);
- In
BitVec.c:215:
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
u64 byte_idx = BIT_INDEX(idx);
- In
BitVec.c:237:
ValidateBitVec(bitvec);
if (bitvec->length == 0) {
LOG_FATAL("Cannot pop from empty bitvector");
}
bool value = BitVecGet(bitvec, bitvec->length - 1);
- In
BitVec.c:247:
ValidateBitVec(bitvec);
if (idx > bitvec->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
}
// For now, implement as push + manual bit shifting (simple but not efficient)
- In
BitVec.c:264:
ValidateBitVec(bv);
if (idx > bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (count == 0) {
- In
BitVec.c:291:
ValidateBitVec(other);
if (idx > bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (other->length == 0) {
- In
BitVec.c:318:
ValidateBitVec(bv);
if (idx > bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (pattern_bits == 0 || pattern_bits > 8) {
- In
BitVec.c:345:
ValidateBitVec(bv);
if (idx >= bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
- In
BitVec.c:364:
ValidateBitVec(bv);
if (idx >= bv->length) {
LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
}
if (count == 0) {
- In
BitVec.c:528:
if (start1 + len > bv1->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
}
if (start2 + len > bv2->length) {
- In
BitVec.c:531:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}
- In
BitVec.c:570:
if (start1 + len > bv1->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
}
if (start2 + len > bv2->length) {
- In
BitVec.c:573:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}
- In
BitVec.c:746:
BitVec BitVecFromStr(const char *str) {
if (!str) {
LOG_FATAL("str is NULL");
}
- In
BitVec.c:769:
ValidateBitVec(bv);
if (!bytes) {
LOG_FATAL("bytes is NULL");
}
if (max_len == 0) {
- In
BitVec.c:772:
}
if (max_len == 0) {
LOG_FATAL("max_len is 0");
}
if (bv->length == 0) {
- In
BitVec.c:798:
BitVec BitVecFromBytes(const u8 *bytes, u64 bit_len) {
if (!bytes) {
LOG_FATAL("bytes is NULL");
}
- In
BitVec.c:1093:
if (!results || max_results == 0) {
LOG_FATAL("results is NULL or max_results is 0");
}
- In
BitVec.c:1117:
ValidateBitVec(bv);
if (!runs || !values || max_runs == 0) {
LOG_FATAL("invalid arguments");
}
- In
BitVec.c:1262:
FREE(prev_row);
FREE(curr_row);
LOG_FATAL("Memory allocation failed");
}
- In
BitVec.c:1588:
ValidateBitVec(bv);
if (!pattern) {
LOG_FATAL("pattern is NULL");
}
- In
BitVec.c:1611:
ValidateBitVec(bv);
if (!patterns) {
LOG_FATAL("invalid BitVecs object provided");
}
- In
BitVec.c:1626:
ValidateBitVec(bv);
if (!patterns) {
LOG_FATAL("invalid arguments");
}
- In
BitVec.c:1640:
void ValidateBitVec(const BitVec *bv) {
if (!(bv)) {
LOG_FATAL("Invalid bitvec object: NULL.");
}
if ((bv)->__magic != MISRA_BITVEC_MAGIC) {
- In
BitVec.c:1643:
}
if ((bv)->__magic != MISRA_BITVEC_MAGIC) {
LOG_FATAL("Invalid bitvec. Either uninitialized or curropted!");
}
if ((bv)->length > (bv)->capacity) {
- In
BitVec.c:1646:
}
if ((bv)->length > (bv)->capacity) {
LOG_FATAL("Invalid bitvec object: length > capacity.");
}
if ((bv)->length > 0 && !(bv)->data) {
- In
BitVec.c:1649:
}
if ((bv)->length > 0 && !(bv)->data) {
LOG_FATAL("Invalid bitvec object: length > 0 but data is NULL.");
}
if ((bv)->capacity > 0 && (bv)->byte_size * 8 < (bv)->capacity) {
- In
BitVec.c:1652:
}
if ((bv)->capacity > 0 && (bv)->byte_size * 8 < (bv)->capacity) {
LOG_FATAL("Invalid bitvec object: byte_u64 too small for capacity.");
}
if ((bv)->data) {
- In
Iter.c:21:
}
} else {
LOG_FATAL("Invalid direction");
return 0;
}
- In
Iter.c:28:
void validate_iter(GenericIter *i) {
if (((i)->dir != -1 && (i)->dir != 1) || !(i)->alignment || !(i)->length || (i)->pos >= (i)->length) {
LOG_FATAL("Invalid iter object.");
}
(void)(*(char *)(void *)((i)->data));
- In
Proc.c:230:
void SysProcWait(SysProc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");
}
- In
Proc.c:267:
SysProcStatus SysProcWaitFor(SysProc *proc, u64 timeout_ms) {
if (!proc) {
LOG_FATAL("Invalid arguments");
}
- In
Proc.c:335:
void SysProcTerminate(SysProc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");
}
- In
Proc.c:390:
void SysProcDestroy(SysProc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");
}
SysProcTerminate(proc);
- In
Proc.c:409:
i32 SysProcWriteToStdin(SysProc *proc, Str *buf) {
if (!proc || !buf) {
LOG_FATAL("Invalid arguments");
}
- In
Proc.c:424:
i32 sys_proc_read_internal(SysProc *proc, Str *buf, bool is_stdout) {
if (!proc || !buf) {
LOG_FATAL("Invalid argument");
}
- In
Proc.c:516:
i32 SysProcGetId(SysProc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");
}
- In
Proc.c:528:
i32 SysProcIsRunning(SysProc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");
}
- In
Proc.c:552:
i32 SysProcGetExitCode(SysProc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");
}
- In
Proc.c:580:
Str *SysGetCurrentExecutablePath(Str *exe_path) {
if (!exe_path) {
LOG_FATAL("Invalid arguments: exe_path is NULL");
}
- In
Dir.c:50:
SysDirEntry *SysDirEntryInitCopy(SysDirEntry *dst, SysDirEntry *src) {
if (!dst || !src) {
LOG_FATAL("invalid arguments.");
}
- In
Dir.c:62:
SysDirEntry *SysDirEntryDeinitCopy(SysDirEntry *copy) {
if (!copy) {
LOG_FATAL("invalid arguments.");
}
- In
Dir.c:75:
SysDirContents SysGetDirContents(const char *path) {
if (!path) {
LOG_FATAL("Invalid argument");
}
- In
Dir.c:121:
SysDirContents SysGetDirContents(const char *path) {
if (!path) {
LOG_FATAL("invalid arguments.");
}
- In
MisraDoc.c:113:
Scope(&config, StrDeinit, {
if (!ReadCompleteFile(config_path, &config.data, &config.length, &config.capacity)) {
LOG_FATAL("Failed to read config file.");
}
StrIter json = StrIterFromStr(config);
- In
ElfInfo.c:336:
int main(int argc, char **argv) {
if (argc < 2) {
LOG_FATAL("USAGE: {} {}", argv[0], argv[1]);
}
- In
ElfInfo.c:355:
// for an invalid elf magic, any subsequent fields will be zero, and hence will be invalid
if (eh.meta.class != ELF_CLASS_64) {
LOG_FATAL("Only 64-bit binaries supported for now. Class for provided binary is = {}", eh.meta.class);
}
BitVecPush(&pattern, true);
BitVecFindPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindLastPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindLastPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
// Don't create pattern BitVec since we're testing NULL source validation
BitVecFindAllPattern(NULL, (BitVec *)0x1, results, 10); // Should cause LOG_FATAL
return true;
BitVecPush(&source, false);
BitVecFindAllPattern(&source, NULL, results, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, NULL, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, results, 0); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindLastPattern(NULL, &pattern); // Should cause LOG_FATAL
BitVecDeinit(&pattern);
BitVecPush(&source, false);
BitVecFindLastPattern(&source, NULL); // Should cause LOG_FATAL
BitVecDeinit(&source);
// Don't create pattern BitVec since we're testing NULL source validation
BitVecFindAllPattern(NULL, (BitVec *)0x1, results, 10); // Should cause LOG_FATAL
return true;
BitVecPush(&source, false);
BitVecFindAllPattern(&source, NULL, results, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, NULL, 10); // Should cause LOG_FATAL
BitVecDeinit(&source);
BitVecPush(&pattern, true);
BitVecFindAllPattern(&source, &pattern, results, 0); // Should cause LOG_FATAL
BitVecDeinit(&source);
- In
Insert.h:207:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
VEC_DATATYPE(v) __tmp_val_##__LINE__ = *(varr); \
- In
Insert.h:244:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
VEC_DATATYPE(v) __tmp_val_##__LINE__ = *(varr); \
- In
Insert.h:303:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
VEC_DATATYPE(v) __tmp_val_##__LINE__ = *(varr); \
- In
Insert.h:348:
{ \
if (varr == NULL) { \
LOG_FATAL("Expected a valid pointer"); \
} \
VEC_DATATYPE(v) __tmp_val_##__LINE__ = *(varr); \