From 4b93a3ecf7514d181730f5a8f8bfe7e086160b4c Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Mon, 1 Oct 2018 10:33:34 +0200 Subject: remove klee_alias_function() this function can be used to modify the control flow of the program on different paths, enabling self-modifying code. --- test/Feature/AliasFunction.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 test/Feature/AliasFunction.c (limited to 'test/Feature/AliasFunction.c') diff --git a/test/Feature/AliasFunction.c b/test/Feature/AliasFunction.c deleted file mode 100644 index 6a5e9174..00000000 --- a/test/Feature/AliasFunction.c +++ /dev/null @@ -1,37 +0,0 @@ -// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc -// RUN: rm -rf %t.klee-out -// RUN: %klee --output-dir=%t.klee-out %t1.bc > %t1.log -// RUN: grep -c foo %t1.log | grep 5 -// RUN: grep -c bar %t1.log | grep 4 - -#include -#include - -void __attribute__ ((noinline)) foo() { printf(" foo()\n"); } -void __attribute__ ((noinline)) bar() { printf(" bar()\n"); } - -int main() { - int x; - klee_make_symbolic(&x, sizeof(x), "x"); - - // call once, so that it is not removed by optimizations - bar(); - - // no aliases - foo(); - - if (x > 10) - { - // foo -> bar - klee_alias_function("foo", "bar"); - - if (x > 20) - foo(); - } - - foo(); - - // undo - klee_alias_function("foo", "foo"); - foo(); -} -- cgit 1.4.1