LOG_FATAL

Table of Contents

LOG_FATAL

Description

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)

    { body }                                                                                               \
    if ((idx) >= (bv)->length) {                                                                           \
    LOG_FATAL("BitVec range overflow : Invalid index reached during Foreach iteration.");              \
    }                                                                                                      \
    }                                                                                                          \
    { body }                                                                                               \
    if ((idx) >= (bv)->length) {                                                                           \
    LOG_FATAL("BitVec range overflow : Invalid index reached during Foreach reverse iteration.");      \
    }                                                                                                      \
    if (idx == 0)                                                                                          \
    if ((bv)->length > 0) {                                                                                        \
    if ((_e) > (bv)->length) {                                                                                 \
    LOG_FATAL(                                                                                             \
    "BitVec range overflow: End index {} exceeds bitvector length {}. "                                \
    "If you intended to iterate over all bits, use BitVecForeach instead.",                            \
    }                                                                                                          \
    if ((_s) >= (bv)->length) {                                                                                \
    LOG_FATAL(                                                                                             \
    "BitVec range overflow: Start index {} exceeds or equals bitvector length {}.",                    \
    _s,                                                                                                \
    }                                                                                                          \
    if ((_s) > (_e)) {                                                                                         \
    LOG_FATAL("Invalid range: Start index {} must be less than or equal to end index {}.", _s, _e);        \
    }                                                                                                          \
    for ((idx) = (_s); (idx) < (_e); ++(idx)) {                                                                \
    for ((idx) = (_s); (idx) < (_e); ++(idx)) {                                                                \
    if ((idx) >= (bv)->length) {                                                                           \
    LOG_FATAL(                                                                                         \
    "BitVec range overflow: Index {} exceeds bitvector length {} during iteration.",               \
    idx,                                                                                           \
    { body }                                                                                               \
    if ((idx) >= (v)->length) {                                                                            \
    LOG_FATAL("Vector range overflow : Invalid index reached during Foreach iteration.");              \
    }                                                                                                      \
    }                                                                                                          \
    { body }                                                                                               \
    if ((idx) >= (v)->length) {                                                                            \
    LOG_FATAL("Vector range overflow : Invalid index reached during Foreach reverse iteration.");      \
    }                                                                                                      \
    if (idx == 0)                                                                                          \
    var = VecPtrAt(v, idx);                                                                                \
    body if ((idx) >= (v)->length) {                                                                       \
    LOG_FATAL("Vector range overflow : Invalid index reached during Foreach iteration.");              \
    }                                                                                                      \
    }                                                                                                          \
    { body }                                                                                               \
    if ((idx) >= (v)->length) {                                                                            \
    LOG_FATAL("Vector range overflow : Invalid index reached during Foreach reverse iteration.");      \
    }                                                                                                      \
    if (idx == 0)                                                                                          \
    if ((v)->length > 0) {                                                                                         \
    if ((_e) > (v)->length) {                                                                                  \
    LOG_FATAL(                                                                                             \
    "Vector range overflow: End index %zu exceeds vector length %zu. "                                 \
    "If you intended to iterate over all items, use VecForeach instead.",                              \
    }                                                                                                          \
    if ((_s) >= (v)->length) {                                                                                 \
    LOG_FATAL(                                                                                             \
    "Vector range overflow: Start index %zu exceeds or equals vector length %zu.",                     \
    _s,                                                                                                \
    }                                                                                                          \
    if ((_s) > (_e)) {                                                                                         \
    LOG_FATAL("Invalid range: Start index %zu must be less than or equal to end index %zu.", _s, _e);      \
    }                                                                                                          \
    for ((idx) = (_s); (idx) < (_e); ++(idx)) {                                                                \
    for ((idx) = (_s); (idx) < (_e); ++(idx)) {                                                                \
    if ((idx) >= (v)->length) {                                                                            \
    LOG_FATAL(                                                                                         \
    "Vector range overflow: Index %zu exceeds vector length %zu during iteration.",                \
    idx,                                                                                           \
    if ((v)->length > 0) {                                                                                         \
    if ((_e) > (v)->length) {                                                                                  \
    LOG_FATAL(                                                                                             \
    "Vector range overflow: End index {} exceeds vector length {}. "                                   \
    "If you intended to iterate over all items, use VecForeach instead.",                              \
    }                                                                                                          \
    if ((_s) >= (v)->length) {                                                                                 \
    LOG_FATAL(                                                                                             \
    "Vector range overflow: Start index {} exceeds or equals vector length {}.",                       \
    _e,                                                                                                \
    }                                                                                                          \
    if ((_s) > (_e)) {                                                                                         \
    LOG_FATAL("Invalid range: Start index {} must be less than or equal to end index {}.", _s, _e);        \
    }                                                                                                          \
    for ((idx) = (_s); (idx) < (_e); ++(idx)) {                                                                \
    for ((idx) = (_s); (idx) < (_e); ++(idx)) {                                                                \
    if ((idx) >= (v)->length) {                                                                            \
    LOG_FATAL(                                                                                         \
    "Vector range overflow: Index {} exceeds vector length {} during iteration.",                  \
    idx,                                                                                           \
    {                                                                                                              \
    if (varr == NULL) {                                                                                        \
    LOG_FATAL("Expected a valid pointer");                                                                 \
    }                                                                                                          \
    const VEC_DATATYPE(v) __x = *(varr);                                                                       \
    {                                                                                                              \
    if (varr == NULL) {                                                                                        \
    LOG_FATAL("Expected a valid pointer");                                                                 \
    }                                                                                                          \
    const VEC_DATATYPE(v) __x = *(varr);                                                                       \
    {                                                                                                              \
    if (varr == NULL) {                                                                                        \
    LOG_FATAL("Expected a valid pointer");                                                                 \
    }                                                                                                          \
    const VEC_DATATYPE(v) __x = *(varr);                                                                       \
    {                                                                                                              \
    if (varr == NULL) {                                                                                        \
    LOG_FATAL("Expected a valid pointer");                                                                 \
    }                                                                                                          \
    const VEC_DATATYPE(v) __x = *(varr);                                                                       \
    i32 MemCompare(const void* p1, const void* p2, size n) {
    if (!p1 || !p2) {
    LOG_FATAL("Invalid arguments");
    }
    void* MemCopy(void* dst, const void* src, size n) {
    if (!dst || !src) {
    LOG_FATAL("Invalid arguments");
    }
    void* MemMove(void* dst, const void* src, size n) {
    if (!dst || !src) {
    LOG_FATAL("Invalid arguments");
    }
    void* MemSet(void* dst, i32 val, size n) {
    if (!dst) {
    LOG_FATAL("Invalid arguments");
    }
    size ZstrLen(const char* str) {
    if (!str) {
    LOG_FATAL("Invalid arguments");
    }
    i32 ZstrCompare(const char* s1, const char* s2) {
    if (!s1 || !s2) {
    LOG_FATAL("Invalid arguments");
    }
    i32 ZstrCompareN(const char* s1, const char* s2, size n) {
    if (!s1 || !s2) {
    LOG_FATAL("Invalid arguments");
    }
    char* ZstrDupN(const char* src, size n) {
    if (!src) {
    LOG_FATAL("Invalid arguments");
    }
    char* ZstrFindSubstring(const char* haystack, const char* needle) {
    if (!haystack || !needle) {
    LOG_FATAL("Invalid arguments");
    }
    char* ZstrFindSubstringN(const char* haystack, const char* needle, size needle_len) {
    if (!haystack || !needle) {
    LOG_FATAL("Invalid arguments");
    }
    StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
    SysStrError(errno, &syserr);
    LOG_FATAL("malloc() failed : {}", syserr);
    });
    }
    static bool ParseFormatSpec(const char* spec, u32 len, FmtInfo* fi) {
    if (!spec || !fi) {
    LOG_FATAL("Invalid arguments to ParseFormatSpec");
    return false;
    }
    bool StrWriteFmtInternal(Str* o, const char* fmt, TypeSpecificIO* args, size argc) {
    if (!o || !fmt) {
    LOG_FATAL("Invalid arguments");
    return false;
    }
    }
    #else
    LOG_FATAL("Invalid writer or data pointer");
    #endif
    }
    const char* StrReadFmtInternal(const char* input, const char* fmtstr, TypeSpecificIO* argv, size argc) {
    if (!input || !fmtstr) {
    LOG_FATAL("Invalid arguments");
    }
    void FReadFmtInternal(FILE* file, const char* fmtstr, TypeSpecificIO* argv, size argc) {
    if (!file || !fmtstr) {
    LOG_FATAL("Invalid arguments");
    }
    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");
    }
    static inline void write_char_internal(Str* o, FormatFlags flags, const char* vs, size len) {
    if (!o || !vs || !len) {
    LOG_FATAL("Invalid arguments");
    }
    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");
    }
    void _write_Str(Str* o, FmtInfo* fmt_info, Str* s) {
    if (!o || !s || !fmt_info) {
    LOG_FATAL("Invalid arguments");
    }
    void _write_Zstr(Str* o, FmtInfo* fmt_info, const char** s) {
    if (!o || !s || !*s || !fmt_info) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_u64(Str* o, FmtInfo* fmt_info, u64* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_u32(Str* o, FmtInfo* fmt_info, u32* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_u16(Str* o, FmtInfo* fmt_info, u16* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_u8(Str* o, FmtInfo* fmt_info, u8* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_i64(Str* o, FmtInfo* fmt_info, i64* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_i32(Str* o, FmtInfo* fmt_info, i32* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_i16(Str* o, FmtInfo* fmt_info, i16* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_i8(Str* o, FmtInfo* fmt_info, i8* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_f64(Str* o, FmtInfo* fmt_info, f64* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    void _write_f32(Str* o, FmtInfo* fmt_info, f32* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    const char* _read_Str(const char* i, FmtInfo* fmt_info, Str* s) {
    if (!i || !s)
    LOG_FATAL("Invalid arguments");
    
    ValidateStr(s);
    const char* _read_f64(const char* i, FmtInfo* fmt_info, f64* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_u8(const char* i, FmtInfo* fmt_info, u8* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Skip whitespace
    const char* _read_u16(const char* i, FmtInfo* fmt_info, u16* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_u32(const char* i, FmtInfo* fmt_info, u32* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_u64(const char* i, FmtInfo* fmt_info, u64* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_i8(const char* i, FmtInfo* fmt_info, i8* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_i16(const char* i, FmtInfo* fmt_info, i16* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_i32(const char* i, FmtInfo* fmt_info, i32* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    const char* _read_i64(const char* i, FmtInfo* fmt_info, i64* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    (void)fmt_info; // Unused parameter
    if (!i || !out)
    LOG_FATAL("Invalid arguments");
    
    // For string types, :c has no effect - work like regular string reading
    void _write_BitVec(Str* o, FmtInfo* fmt_info, BitVec* bv) {
    if (!o || !fmt_info || !bv) {
    LOG_FATAL("Invalid arguments");
    return;
    }
    (void)fmt_info;
    (void)s;
    LOG_FATAL("Attempt to write unsupported type");
    }
    (void)fmt_info; // Unused parameter
    if (!i || !bv) {
    LOG_FATAL("Invalid arguments");
    return i;
    }
    (void)fmt_info; // Unused parameter
    (void)s;
    LOG_FATAL("Attempt to read unsupported type.");
    return i;
    }
    const char* _read_f32(const char* i, FmtInfo* fmt_info, f32* v) {
    if (!i || !v)
    LOG_FATAL("Invalid arguments");
    
    // Handle character format specifier
    static void _write_r8(Str* o, FmtInfo* fmt_info, u8* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    }
    static void _write_r16(Str* o, FmtInfo* fmt_info, u16* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    }
    case ENDIAN_NATIVE :
    default : {
    LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
    }
    }
    static void _write_r32(Str* o, FmtInfo* fmt_info, u32* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    }
    case ENDIAN_NATIVE :
    default : {
    LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
    }
    }
    static void _write_r64(Str* o, FmtInfo* fmt_info, u64* v) {
    if (!o || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    }
    case ENDIAN_NATIVE :
    default : {
    LOG_FATAL("Invalid endianness provided. Unexpected code reached.");
    }
    }
    static const char* _read_r8(const char* i, FmtInfo* fmt_info, u8* v) {
    if (!i || !fmt_info || !v) {
    LOG_FATAL("Invalid arguments");
    }
    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");
    }
    case ENDIAN_NATIVE :
    default :
    LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r16.");
    }
    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");
    }
    case ENDIAN_NATIVE :
    default :
    LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r32.");
    }
    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");
    }
    case ENDIAN_NATIVE :
    default :
    LOG_FATAL("Invalid endianness provided. Unexpected code reached in _read_r64.");
    }
    }
    } else {
    LOG_FATAL("Invalid direction");
    return 0;
    }
    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));
    
    if (!new_data) {
    LOG_FATAL("Failed to allocate memory for bitvec");
    return;
    }
    ValidateBitVec(bitvec);
    if (idx >= bitvec->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
    }
    u64 byte_idx   = BIT_INDEX(idx);
    ValidateBitVec(bitvec);
    if (idx >= bitvec->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
    }
    u64 byte_idx   = BIT_INDEX(idx);
    ValidateBitVec(bitvec);
    if (idx >= bitvec->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bitvec->length);
    }
    u64 byte_idx   = BIT_INDEX(idx);
    ValidateBitVec(bitvec);
    if (bitvec->length == 0) {
    LOG_FATAL("Cannot pop from empty bitvector");
    }
    bool value = BitVecGet(bitvec, bitvec->length - 1);
    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)
    ValidateBitVec(bv);
    if (idx > bv->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
    }
    if (count == 0) {
    ValidateBitVec(other);
    if (idx > bv->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
    }
    if (other->length == 0) {
    ValidateBitVec(bv);
    if (idx > bv->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
    }
    if (pattern_bits == 0 || pattern_bits > 8) {
    ValidateBitVec(bv);
    if (idx >= bv->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
    }
    ValidateBitVec(bv);
    if (idx >= bv->length) {
    LOG_FATAL("Index {} exceeds bitvector length {}", idx, bv->length);
    }
    if (count == 0) {
    
    if (start1 + len > bv1->length) {
    LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
    }
    if (start2 + len > bv2->length) {
    }
    if (start2 + len > bv2->length) {
    LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
    }
    
    if (start1 + len > bv1->length) {
    LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
    }
    if (start2 + len > bv2->length) {
    }
    if (start2 + len > bv2->length) {
    LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
    }
    BitVec BitVecFromStr(const char *str) {
    if (!str) {
    LOG_FATAL("str is NULL");
    }
    ValidateBitVec(bv);
    if (!bytes) {
    LOG_FATAL("bytes is NULL");
    }
    if (max_len == 0) {
    }
    if (max_len == 0) {
    LOG_FATAL("max_len is 0");
    }
    if (bv->length == 0) {
    BitVec BitVecFromBytes(const u8 *bytes, u64 bit_len) {
    if (!bytes) {
    LOG_FATAL("bytes is NULL");
    }
    
    if (!results || max_results == 0) {
    LOG_FATAL("results is NULL or max_results is 0");
    }
    ValidateBitVec(bv);
    if (!runs || !values || max_runs == 0) {
    LOG_FATAL("invalid arguments");
    }
    if (curr_row)
    free(curr_row);
    LOG_FATAL("Memory allocation failed");
    }
    ValidateBitVec(bv);
    if (!pattern) {
    LOG_FATAL("pattern is NULL");
    }
    ValidateBitVec(bv);
    if (!patterns) {
    LOG_FATAL("invalid BitVecs object provided");
    }
    ValidateBitVec(bv);
    if (!patterns) {
    LOG_FATAL("invalid arguments");
    }
    void ValidateBitVec(const BitVec *bv) {
    if (!(bv)) {
    LOG_FATAL("Invalid bitvec object: NULL.");
    }
    if ((bv)->length > (bv)->capacity) {
    }
    if ((bv)->length > (bv)->capacity) {
    LOG_FATAL("Invalid bitvec object: length > capacity.");
    }
    if ((bv)->length > 0 && !(bv)->data) {
    }
    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) {
    }
    if ((bv)->capacity > 0 && (bv)->byte_size * 8 < (bv)->capacity) {
    LOG_FATAL("Invalid bitvec object: byte_u64 too small for capacity.");
    }
    if ((bv)->data) {
    
    if (!v->alignment) {
    LOG_FATAL("Invalid alignment. Did you initialize before use? Aborting...");
    }
    StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
    SysStrError(errno, &syserr);
    LOG_FATAL("realloc() failed : {}", syserr);
    });
    }
    StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
    SysStrError(errno, &syserr);
    LOG_FATAL("realloc() failed : {}", syserr);
    });
    }
    
    if (idx > vec->length) {
    LOG_FATAL("vector index out of bounds, insertion at index greater than length");
    }
    
    if (idx > vec->length) {
    LOG_FATAL("vector index out of bounds, insertion at index greater than length");
    }
    
    if (start + count > vec->length) {
    LOG_FATAL("vector range out of bounds.");
    }
    
    if (start + count > vec->length) {
    LOG_FATAL("vector range out of bounds.");
    }
    
    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."
    
    if (idx1 >= vec->length || idx2 >= vec->length) {
    LOG_FATAL("vector index out of bounds.");
    }
    void validate_vec(const GenericVec *v) {
    if (!(v)) {
    LOG_FATAL("NULL vec object pointer.");
    }
    if (!(v)->alignment || (v)->length > (v)->capacity) {
    }
    if (!(v)->alignment || (v)->length > (v)->capacity) {
    LOG_FATAL("Invalid vec object.");
    }
    // if memory is invalid, system will segfault here
    int main(int argc, char** argv) {
    if (argc < 2) {
    LOG_FATAL("USAGE: {} {}", argv[0], argv[1]);
    }
    // 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);
    }
    Scope(&config, StrDeinit, {
    if (!ReadCompleteFile(config_path, &config.data, &config.length, &config.capacity)) {
    LOG_FATAL("Failed to read config file.");
    }
    StrIter json = StrIterFromStr(config);
    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);

Share :

Related Posts

JW_BOOL

JW_BOOL Description Append a boolean value to the JSON as unquoted true/false.

Read More

ReadFmt

ReadFmt Description Read formatted input from the standard input stream (stdin). This is a convenience macro calling FReadFmt with stdin.

Read More

FReadFmt

FReadFmt Description Read formatted data from a file stream. This is a macro wrapper around FReadFmtInternal.

Read More