4 ms·
PREfix incorporated analysis to identify likely exit functions. This help cut down false positives in situations like if (p == NULL) fatal_error();
by jdp23 14y ago
PREfix incorporated analysis to identify likely exit functions. This help cut down false positives in situations like
if (p == NULL)
fatal_error();
*p = 0;
With the inference-based analysis we did in PREfix, if we don't recognize fatal_error() as a function that's likely to exit the program, we'd report a potential NULL pointer on the next line. But we didn't have the source code for fatal_error, how could we possibly know that? Ideally it would be a volatile function but a lot of older code is very sloppy about that. So we employed various heuristics based on the names of the functions (and gave the user an opportunity to tune the results) ... it worked surprisingly well in practice.