X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=typescript_strings.py;h=d1449c2224fda58e24d142825847c5d150059110;hb=886f4905d378c4225cbf13d53f073022fbb5acbc;hp=84b27c5723a66521d7f737ac486313b1aac52cb2;hpb=e6173a79ce766cef7a660f22fc8fd1220975f6ea;p=ldk-java 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");