Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTBot generate incorrect stubs name for function pointer [BUG] #406

Closed
ladisgin opened this issue Aug 26, 2022 · 0 comments · Fixed by #612
Closed

UTBot generate incorrect stubs name for function pointer [BUG] #406

ladisgin opened this issue Aug 26, 2022 · 0 comments · Fixed by #612
Assignees
Labels
bug Something isn't working c-syntax Related to generation tests for C

Comments

@ladisgin
Copy link
Member

Description
UTBot generate incorrect stubs name for pointer to function inside subclass/subunion
For file:

#include <stddef.h>

struct obstack
{
  int s;
  struct ff {
    void *(*plain) (size_t);
    void *(*extra) (void *, size_t);
  } chunkfun;
};


int foo(struct obstack ob){
    return ob.s;
}

int main(void) {
    return 0;
}

UTBot generate build/main_klee_temp.c which contains:

static void * obstack::ff_extra_stub(void * param1, size_t param2) {
    return NULL;
}

static void * obstack::ff_plain_stub(size_t param1) {
    return NULL;
}

int klee_entry__main_foo__wrapped(int utbot_argc, char ** utbot_argv, char ** utbot_envp) {
    struct obstack ob;
    klee_make_symbolic(&ob, sizeof(ob), "ob");
    klee_prefer_cex(&ob, ob.s >= -10  & ob.s <= 10);
    ob.chunkfun.plain = *obstack::ff_plain_stub;
    ob.chunkfun.extra = *obstack::ff_extra_stub;
    //////////////////////////////////////////// 
    int utbot_result;
    klee_make_symbolic(&utbot_result, sizeof(utbot_result), "utbot_result");
    int utbot_tmp = foo(ob);
    klee_assume(utbot_tmp == utbot_result);
    return 0;
}
@ladisgin ladisgin added the bug Something isn't working label Aug 26, 2022
@ladisgin ladisgin self-assigned this Aug 26, 2022
@korifey korifey moved this to Todo in UTBot C/C++ Aug 26, 2022
@ladisgin ladisgin added the c-syntax Related to generation tests for C label Aug 26, 2022
@github-project-automation github-project-automation bot moved this from Todo to Done in UTBot C/C++ Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c-syntax Related to generation tests for C
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant