symex-intro

Material for an introductory presentation for symbolic execution.

git clone https://git.8pit.net/symex-intro.git

 1#include <assert.h>
 2#include <limits.h>
 3#include <klee/klee.h>
 4
 5void somefunc(int n) {
 6  if (n < 0)
 7    n = n * -1;
 8  else
 9    n = 1;
10
11  if (n <= 0) // && n != INT_MIN
12    assert(0 && "reachable");
13}
14
15int main(void) {
16  int n;
17  klee_make_symbolic(&n, sizeof(n), "n");
18  somefunc(n);
19  return 0;
20}