TIER B: returns true if cbm_extract_file CRASHES (signal) on `content`. * Runs in a forked child so the crash doesn't take down the repro runner. */
| 168 | /* TIER B: returns true if cbm_extract_file CRASHES (signal) on `content`. |
| 169 | * Runs in a forked child so the crash doesn't take down the repro runner. */ |
| 170 | static inline bool rh_extract_crashes(const char *content, CBMLanguage lang, const char *relpath) { |
| 171 | #if defined(_WIN32) |
| 172 | CBMFileResult *r = |
| 173 | cbm_extract_file(content, (int)strlen(content), lang, "repro", relpath, 0, NULL, NULL); |
| 174 | if (r) |
| 175 | cbm_free_result(r); |
| 176 | return false; |
| 177 | #else |
| 178 | fflush(NULL); |
| 179 | pid_t pid = fork(); |
| 180 | if (pid < 0) |
| 181 | return false; |
| 182 | if (pid == 0) { |
| 183 | CBMFileResult *r = |
| 184 | cbm_extract_file(content, (int)strlen(content), lang, "repro", relpath, 0, NULL, NULL); |
| 185 | if (r) |
| 186 | cbm_free_result(r); |
| 187 | _exit(0); |
| 188 | } |
| 189 | int status = 0; |
| 190 | (void)waitpid(pid, &status, 0); |
| 191 | return WIFSIGNALED(status); |
| 192 | #endif |
| 193 | } |
| 194 | |
| 195 | #endif /* REPRO_HARNESS_H */ |
nothing calls this directly
no test coverage detected