From 93cc178cfedb281ad05f988850d601e600361d9a Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 27 Aug 2018 15:51:41 +0000 Subject: Add tool to find directly recursive calls in toxcore. We should avoid recursion, as it makes reasoning about stack growth harder. This tool shows (currently) 4 (non-tail) recursive functions, at least 2 of which are easy to fix. --- .travis/cmake-linux | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.travis/cmake-linux') diff --git a/.travis/cmake-linux b/.travis/cmake-linux index fe5de10a..541eb014 100755 --- a/.travis/cmake-linux +++ b/.travis/cmake-linux @@ -53,8 +53,15 @@ travis_install() { } run_static_analysis() { + pylint -E other/analysis/check_recursion + export CPPFLAGS="-isystem $CACHEDIR/include" export LDFLAGS="-L $CACHEDIR/lib" + cat toxav/*.c toxcore/*.c toxencryptsave/*.c \ + | clang `pkg-config --cflags libsodium opus vpx` \ + -Itoxav -Itoxcore -Itoxencryptsave -S -emit-llvm -xc - -o- \ + | opt -analyze -print-callgraph 2>&1 \ + | other/analysis/check_recursion other/analysis/run-clang other/analysis/run-clang-analyze } -- cgit v1.2.3