This skips some debug and error allocations that cannot be handled
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:00:14 2026
(Merged from https://github.com/openssl/openssl/pull/31356)
int triggered;
int counting;
int slow_skipped;
+ int no_check;
} mf;
static int env_is_true(const char *name)
#endif
}
-static int should_fail(void)
+static int should_fail(const char *file)
{
int idx;
if (!mf.counting)
return 0;
+ /* skip if checking errors and file is not set (debug and error parts) */
+ if (!mf.no_check && file == NULL)
+ return 0;
idx = mf.alloc_count++;
{
if (num == 0)
return NULL;
- if (should_fail())
+ if (should_fail(file))
return NULL;
return malloc(num);
}
free(addr);
return NULL;
}
- if (should_fail())
+ if (should_fail(file))
return NULL;
return realloc(addr, num);
}
mf.triggered = 0;
mf.counting = 0;
mf.slow_skipped = 0;
+ mf.no_check = flags & MFAIL_FLAG_NO_CHECK;
if (mf.single_point >= 0) {
mf.mode = MFAIL_MODE_SINGLE;
/* Flags for mfail_init(). */
#define MFAIL_FLAG_COUNT (1 << 0)
+#define MFAIL_FLAG_NO_CHECK (1 << 1)
/* Modes */
#define MFAIL_MODE_EXHAUSTIVE 0
test_flush_stdout();
test_flush_tapout();
- mfail_init(0, 0);
+ mfail_init(0, no_check ? MFAIL_FLAG_NO_CHECK : 0);
while (mfail_has_next()) {
int phase = mfail_get_phase();