── Robustness helper: assert call RETURNS on malformed input ─────────────── * * A truncated version of the fixture is passed through cbm_extract_file. * has_error may be set (1) but the call must return non-NULL. If it returns NULL * the extractor crashed or aborted on bad input -- that is a RED robustness bug. * Returns 0 on PASS, 1 on FAIL. */
| 267 | * Returns 0 on PASS, 1 on FAIL. |
| 268 | */ |
| 269 | static int misc_robustness(const char *lang_tag, const char *bad_src, |
| 270 | CBMLanguage lang, const char *file) { |
| 271 | const char *RED = tf_red(); |
| 272 | const char *RST = tf_reset(); |
| 273 | |
| 274 | CBMFileResult *r = cbm_extract_file(bad_src, (int)strlen(bad_src), |
| 275 | lang, "t", file, 0, NULL, NULL); |
| 276 | if (!r) { |
| 277 | printf(" %sFAIL%s [%s] robustness: extractor returned NULL on malformed input\n", |
| 278 | RED, RST, lang_tag); |
| 279 | return 1; |
| 280 | } |
| 281 | cbm_free_result(r); |
| 282 | return 0; |
| 283 | } |
| 284 | |
| 285 | /* ── ASSEMBLY (structural) ─────────────────────────────────────────────────── |
| 286 | * Idiomatic x86-64 GAS snippet: a global function label, a local label, and a |
no test coverage detected