Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
        char **vector;
        int args;

        s2e_disable_all_apic_interrupts();
        s2e_enable_forking();

        s2e_make_symbolic(&args, sizeof(args), "Number of arguments");

        if (args < 1 || args > 4)
        {
                s2e_get_example(&args, sizeof(args));
                printf("Bad value for args: %d\n", args);
                s2e_kill_state(0, "bad value for args");
                return 2;
        }

        printf("Good value for args\n"); fflush(stdout);

        args= 5;

        s2e_get_example(&args, sizeof(args));
        printf("Got value for args: %d\n", args);
        fflush(stdout);

        printf("Before malloc vector\n");
        vector= malloc((args+1)*sizeof(*vector));
        printf("After malloc vector\n");

        s2e_kill_state(0, "after malloc");
}
Ejemplo n.º 2
0
int main()
{
   unsigned a1, a2, b1, b2;

   s2e_make_symbolic(&a1, sizeof(a1), "a1");
   s2e_make_symbolic(&a2, sizeof(a2), "a2");
   s2e_make_symbolic(&b1, sizeof(b1), "b1");
   s2e_make_symbolic(&b2, sizeof(b2), "b2");

   //Just to make it a bit faster
   s2e_disable_all_apic_interrupts();

   s2e_assert(correct_overlap(a1, a2, b1, b2) == student_overlap(a1, a2, b1, b2));

   s2e_kill_state(0, "This execution path is correct (assertion check passed)");
   return 0;
}