X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=typescript_strings.py;h=d1449c2224fda58e24d142825847c5d150059110;hp=84b27c5723a66521d7f737ac486313b1aac52cb2;hb=52e14d17ace64ef2dd9df182a892fe76ac74305c;hpb=a05d98212a06a79b3dedc8b6a07e24c343752182 diff --git a/typescript_strings.py b/typescript_strings.py index 84b27c57..d1449c22 100644 --- a/typescript_strings.py +++ b/typescript_strings.py @@ -123,6 +123,7 @@ void free(void *ptr); #define FREE(p) if ((unsigned long)(p) > 1024) { free(p); } #define DO_ASSERT(a) (void)(a) #define CHECK(a) +#define CHECK_ACCESS(p) """ else: self.c_file_pfx = self.c_file_pfx + """ @@ -179,6 +180,16 @@ static void FREE(void* ptr) { __real_free(ptr); } +static void CHECK_ACCESS(void* ptr) { + allocation* it = allocation_ll; + while (it->ptr != ptr) { + it = it->next; + if (it == NULL) { + return; // addrsan should catch malloc-unknown and print more info than we have + } + } +} + void* __wrap_malloc(size_t len) { void* res = __real_malloc(len); new_allocation(res, "malloc call");