Skip to content
Snippets Groups Projects
Commit c6191983 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Add a script to tell whether a file can be perfectly parsed by spatch

spatch can let us know whether a file has parsed "perfectly" or
not.  The more perfect it parses, the likelier any semantic patches
are to apply.  I've used this script to identify problem areas in
our code.
parent 9a101c2c
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# Echo the name of every argument of this script that is not "perfect"
# according to coccinelle's --parse-c.
top="$(dirname "$0")/../.."
for fn in "$@"; do
if spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
-I "$top" -I "$top"/src -I "$top"/ext --parse-c "$fn" \
2>/dev/null | grep "perfect = 1" > /dev/null; then
: # it's perfect
else
echo "$fn"
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment