From 2c2547d60d400c094eb5a3272778ed191f03922a Mon Sep 17 00:00:00 2001 From: shuangxiang kan <18550887212@163.com> Date: Mon, 21 Aug 2023 13:18:50 +1000 Subject: [PATCH] =?UTF-8?q?Remove=20=E2=80=9C=5F=5Fattribute=5F=5F((annota?= =?UTF-8?q?te("SVF")))=E2=80=9D=20from=20extapi.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svf-llvm/lib/SVFIRExtAPI.cpp | 8 -- svf-llvm/lib/extapi.c | 159 +---------------------------------- svf/lib/Util/ExtAPI.cpp | 5 +- 3 files changed, 6 insertions(+), 166 deletions(-) diff --git a/svf-llvm/lib/SVFIRExtAPI.cpp b/svf-llvm/lib/SVFIRExtAPI.cpp index 91afc9eb1..8fa16014e 100644 --- a/svf-llvm/lib/SVFIRExtAPI.cpp +++ b/svf-llvm/lib/SVFIRExtAPI.cpp @@ -185,14 +185,6 @@ void SVFIRBuilder::handleExtCall(const CallBase* cs, const SVFFunction* svfCalle if(SVFUtil::isa(cs->getType())) addCopyEdge(getValueNode(cs->getArgOperand(0)), getValueNode(cs)); } - else if (svfCallee->getName().find("_ZNSt5arrayIPK1ALm2EE4backEv") != std::string::npos) - { - NodeID dummy = pag->addDummyValNode(); - AccessPath ap1(0); - addNormalGepEdge(getValueNode(cs->getArgOperand(0)), dummy, ap1); - AccessPath ap2(0); - addNormalGepEdge(dummy, getValueNode(cs), ap2); - } else if(svfCallee->getName().compare("dlsym") == 0) { const Value* src = cs->getArgOperand(1); diff --git a/svf-llvm/lib/extapi.c b/svf-llvm/lib/extapi.c index 01c41612f..b918bca77 100644 --- a/svf-llvm/lib/extapi.c +++ b/svf-llvm/lib/extapi.c @@ -17,7 +17,6 @@ OVERWRITE, // svf function overwrite app function */ __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("OVERWRITE"))) void *SyGetmem(unsigned long size) { @@ -25,7 +24,6 @@ void *SyGetmem(unsigned long size) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) const unsigned short **__ctype_b_loc(void) { @@ -33,7 +31,6 @@ const unsigned short **__ctype_b_loc(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) int **__ctype_tolower_loc(void) { @@ -41,7 +38,6 @@ int **__ctype_tolower_loc(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) int **__ctype_toupper_loc(void) { @@ -49,7 +45,6 @@ int **__ctype_toupper_loc(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) int *__errno_location(void) { @@ -57,7 +52,6 @@ int *__errno_location(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) int * __h_errno_location(void) { @@ -65,7 +59,6 @@ int * __h_errno_location(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) void* __res_state(void) { @@ -73,7 +66,6 @@ void* __res_state(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char *asctime(const void *timeptr) { @@ -81,7 +73,6 @@ char *asctime(const void *timeptr) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * bindtextdomain(const char * domainname, const char * dirname) { @@ -89,7 +80,6 @@ char * bindtextdomain(const char * domainname, const char * dirname) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * bind_textdomain_codeset(const char * domainname, const char * codeset) { @@ -97,7 +87,6 @@ char * bind_textdomain_codeset(const char * domainname, const char * codeset) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char *ctermid(char *s) { @@ -105,7 +94,6 @@ char *ctermid(char *s) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * dcgettext(const char * domainname, const char * msgid, int category) { @@ -113,7 +101,6 @@ char * dcgettext(const char * domainname, const char * msgid, int category) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * dgettext(const char * domainname, const char * msgid) { @@ -121,7 +108,6 @@ char * dgettext(const char * domainname, const char * msgid) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * dngettext(const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n) { @@ -129,7 +115,6 @@ char * dngettext(const char * domainname, const char * msgid, const char * msgid } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) void *fdopen(int fd, const char *mode) { @@ -137,7 +122,6 @@ void *fdopen(int fd, const char *mode) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct group *getgrgid(unsigned int gid) { @@ -145,7 +129,6 @@ struct group *getgrgid(unsigned int gid) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct group *getgrnam(const char *name) { @@ -153,7 +136,6 @@ struct group *getgrnam(const char *name) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct hostent *gethostbyaddr(const void *addr, unsigned int len, int type) { @@ -161,7 +143,6 @@ struct hostent *gethostbyaddr(const void *addr, unsigned int len, int type) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct hostent *gethostbyname(const char *name) { @@ -169,7 +150,6 @@ struct hostent *gethostbyname(const char *name) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct hostent *gethostbyname2(const char *name, int af) { @@ -177,7 +157,6 @@ struct hostent *gethostbyname2(const char *name, int af) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct mntent *getmntent(void *stream) { @@ -185,7 +164,6 @@ struct mntent *getmntent(void *stream) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct protoent *getprotobyname(const char *name) { @@ -193,7 +171,6 @@ struct protoent *getprotobyname(const char *name) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct protoent *getprotobynumber(int proto) { @@ -201,7 +178,6 @@ struct protoent *getprotobynumber(int proto) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct passwd *getpwent(void) { @@ -209,7 +185,6 @@ struct passwd *getpwent(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct passwd *getpwnam(const char *name) { @@ -217,7 +192,6 @@ struct passwd *getpwnam(const char *name) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct passwd *getpwuid(unsigned int uid) { @@ -225,7 +199,6 @@ struct passwd *getpwuid(unsigned int uid) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct servent *getservbyname(const char *name, const char *proto) { @@ -233,7 +206,6 @@ struct servent *getservbyname(const char *name, const char *proto) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct servent *getservbyport(int port, const char *proto) { @@ -241,7 +213,6 @@ struct servent *getservbyport(int port, const char *proto) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct spwd *getspnam(const char *name) { @@ -249,7 +220,6 @@ struct spwd *getspnam(const char *name) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * gettext(const char * msgid) { @@ -257,7 +227,6 @@ char * gettext(const char * msgid) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct tm *gmtime(const void *timer) { @@ -265,7 +234,6 @@ struct tm *gmtime(const void *timer) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) const char *gnu_get_libc_version(void) { @@ -273,7 +241,6 @@ const char *gnu_get_libc_version(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) const char * gnutls_check_version(const char * req_version) { @@ -281,7 +248,6 @@ const char * gnutls_check_version(const char * req_version) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct lconv *localeconv(void) { @@ -289,7 +255,6 @@ struct lconv *localeconv(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) struct tm *localtime(const void *timer) { @@ -297,7 +262,6 @@ struct tm *localtime(const void *timer) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char * ngettext(const char * msgid, const char * msgid_plural, unsigned long int n) { @@ -305,7 +269,6 @@ char * ngettext(const char * msgid, const char * msgid_plural, unsigned long int } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) void *pango_cairo_font_map_get_default(void) { @@ -313,7 +276,6 @@ void *pango_cairo_font_map_get_default(void) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char *re_comp(const char *regex) { @@ -321,7 +283,6 @@ char *re_comp(const char *regex) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char *setlocale(int category, const char *locale) { @@ -329,7 +290,6 @@ char *setlocale(int category, const char *locale) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char *tgoto(const char *cap, int col, int row) { @@ -337,7 +297,6 @@ char *tgoto(const char *cap, int col, int row) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) char *tparm(char *str, ...) { @@ -345,7 +304,6 @@ char *tparm(char *str, ...) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) __attribute__((annotate("STATIC"))) const char *zError(int a) { @@ -353,758 +311,647 @@ const char *zError(int a) } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *fopen(const char *voidname, const char *mode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *fopen64(const char *voidname, const char *mode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) struct dirent64 *readdir64(void *dirp) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *tmpvoid64(void) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *calloc(unsigned long nitems, unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *zmalloc(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *gzdopen(int fd, const char *mode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *iconv_open(const char *tocode, const char *fromcode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *lalloc(unsigned long size, int a) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *lalloc_clear(unsigned long size, int a) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) long *nhalloc(unsigned int a, const char *b, int c) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *oballoc(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *popen(const char *command, const char *type) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *pthread_getspecific(const char *a, const char *b) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) struct dirent *readdir(void *dirp) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* safe_calloc(unsigned nelem, unsigned elsize) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* safe_malloc(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char* safecalloc(int a, int b) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char* safemalloc(int a, int b) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *setmntent(const char *voidname, const char *type) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *shmat(int shmid, const void *shmaddr, int shmflg) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* __sysv_signal(int a, void *b) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void (*signal(int sig, void (*func)(int)))(int) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *tempnam(const char *dir, const char *pfx) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *tmpvoid(void) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* xcalloc(unsigned long size1, unsigned long size2) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* xmalloc(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *_Znam(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *_Znaj(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *_Znwj(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *__cxa_allocate_exception(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* aligned_alloc(unsigned long size1, unsigned long size2) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* memalign(unsigned long size1, unsigned long size2) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *valloc(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *mmap64(void *addr, unsigned long len, int prot, int flags, int fildes, long off) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *XSetLocaleModifiers(char *a) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char * __strdup(const char * string) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *crypt(const char *key, const char *salt) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *ctime(const void *timer) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *dlerror(void) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *dlopen(const char *voidname, int flags) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) const char *gai_strerror(int errcode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) const char *gcry_cipher_algo_name(int errcode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) const char *svfgcry_md_algo_name_(int errcode) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *getenv(const char *name) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *getlogin(void) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *getpass(const char *prompt) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) const char * gnutls_strerror(int error) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) const char *gpg_strerror(unsigned int a) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) const char * gzerror(void* file, int * errnum) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *inet_ntoa(unsigned int in) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *initscr(void) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void* llvm_stacksave() { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *mmap(void *addr, unsigned long len, int prot, int flags, int fildes, long off) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *newwin(int nlines, int ncols, int begin_y, int begin_x) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *nl_langinfo(int item) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *opendir(const char *name) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *sbrk(long increment) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *strdup(const char *s) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *strerror(int errnum) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *strsignal(int errnum) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *textdomain(const char * domainname) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *tgetstr(char *id, char **area) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *tigetstr(char *capname) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *tmpnam(char *s) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) char *ttyname(int fd) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *malloc(unsigned long size) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) char *getcwd(char *buf, unsigned long size) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) char *mem_realloc(void *ptr, unsigned long size) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) char *realloc(void *ptr, unsigned long size) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) void* safe_realloc(void *p, unsigned long n) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) void* saferealloc(void *p, unsigned long n1, unsigned long n2) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) void* safexrealloc() { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) char *strtok(char *str, const char *delim) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) char *strtok_r(char *str, const char *delim, char **saveptr) { return NULL; } __attribute__((annotate("REALLOC_RET"))) -__attribute__((annotate("SVF"))) void *xrealloc(void *ptr, unsigned long bytes) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *_Znwm(unsigned long size) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *_ZnwmRKSt9nothrow_t(unsigned long size, void *) { return NULL; } __attribute__((annotate("ALLOC_RET"))) -__attribute__((annotate("SVF"))) void *_ZnamRKSt9nothrow_t(unsigned long size, void *) { return NULL; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int asprintf(char **restrict strp, const char *restrict fmt, ...) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int vasprintf(char **strp, const char *fmt, void* ap) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int db_create(void **dbp, void *dbenv, unsigned int flags) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int gnutls_pkcs12_bag_init(void *a) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int gnutls_pkcs12_init(void *a) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int gnutls_x509_crt_init(void *a) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int gnutls_x509_privkey_init(void *a) { return 0; } __attribute__((annotate("ALLOC_ARG0"))) -__attribute__((annotate("SVF"))) int posix_memalign(void **a, unsigned long b, unsigned long c) { return 0; } __attribute__((annotate("ALLOC_ARG1"))) -__attribute__((annotate("SVF"))) int scandir(const char *restrict dirp, struct dirent ***restrict namelist, int (*filter)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **)) { return 0; } __attribute__((annotate("ALLOC_ARG2"))) -__attribute__((annotate("SVF"))) int XmbTextPropertyToTextList(void *a, void *b, char ***c, int *d) { return 0; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void llvm_memcpy_p0i8_p0i8_i64(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void llvm_memcpy_p0i8_p0i8_i32(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void llvm_memcpy(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void llvm_memmove(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void llvm_memmove_p0i8_p0i8_i64(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void llvm_memmove_p0i8_p0i8_i32(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void __memcpy_chk(char* dst, char* src, int sz, int flag){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void *memmove(void *str1, const void *str2, unsigned long n) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void bcopy(const void *s1, void *s2, unsigned long n){} __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void *memccpy( void * restrict dest, const void * restrict src, int c, unsigned long count) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) void __memmove_chk(char* dst, char* src, int sz){} __attribute__((annotate("MEMSET"))) -__attribute__((annotate("SVF"))) void llvm_memset(char* dst, char elem, int sz, int flag){} __attribute__((annotate("MEMSET"))) -__attribute__((annotate("SVF"))) void llvm_memset_p0i8_i32(char* dst, char elem, int sz, int flag){} __attribute__((annotate("MEMSET"))) -__attribute__((annotate("SVF"))) void llvm_memset_p0i8_i64(char* dst, char elem, int sz, int flag){} __attribute__((annotate("MEMSET"))) -__attribute__((annotate("SVF"))) char *__memset_chk(char * dest, int c, unsigned long destlen, int flag) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char * __strcpy_chk(char * dest, const char * src, unsigned long destlen) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char *__strcat_chk(char * dest, const char * src, unsigned long destlen) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char *stpcpy(char *restrict dst, const char *restrict src) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char *strcat(char *dest, const char *src) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char *strcpy(char *dest, const char *src) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char *strncat(char *dest, const char *src, unsigned long n) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) char *strncpy(char *dest, const char *src, unsigned long n) { return NULL; } __attribute__((annotate("MEMCPY"))) -__attribute__((annotate("SVF"))) unsigned long iconv(void* cd, char **restrict inbuf, unsigned long *restrict inbytesleft, char **restrict outbuf, unsigned long *restrict outbytesleft) { return 0; } __attribute__((annotate("OVERWRITE"))) -__attribute__((annotate("SVF"))) void* _ZNSt5arrayIPK1ALm2EE4backEv(void *arg) { - return NULL; + void* ptr1 = (char*)arg + 0; + void* ptr2 = (char*)ptr1 + 0; + return ptr2; } diff --git a/svf/lib/Util/ExtAPI.cpp b/svf/lib/Util/ExtAPI.cpp index 8d7fe5f76..1e082ff9b 100644 --- a/svf/lib/Util/ExtAPI.cpp +++ b/svf/lib/Util/ExtAPI.cpp @@ -129,7 +129,8 @@ bool ExtAPI::is_ext(const SVFFunction* F) assert(F && "Null SVFFunction* pointer"); if (F->isDeclaration() || F->isIntrinsic()) return true; + else if (hasExtFuncAnnotation(F, "OVERWRITE") && F->getAnnotations().size() == 1) + return false; else - return hasExtFuncAnnotation(F, "SVF"); - return false; + return !F->getAnnotations().empty(); } \ No newline at end of file