Browse Source

intermediate changes
ref:363c37688efcb336560beba78d1acf0737637ef6

arcadia-devtools 2 years ago
parent
commit
a482a42aab
2 changed files with 15 additions and 0 deletions
  1. 2 0
      build/rules/autocheck.blacklist
  2. 13 0
      contrib/python/cffi/c/lib_obj.c

+ 2 - 0
build/rules/autocheck.blacklist

@@ -1399,3 +1399,5 @@ noc/traffic/dns/junk/e2
 noc/traffic/dns/junk/lxs
 noc/traffic/dns/junk/dns-api
 adv/pcode/mobileadssdk/ios/sample-public
+noc/traffic/dns/junk/cc-core
+adv/pcode/mobileadssdk/ios/sample-internal

+ 13 - 0
contrib/python/cffi/c/lib_obj.c

@@ -15,6 +15,18 @@
    __getattr__.
 */
 
+#if defined(_asan_enabled_)
+void __lsan_ignore_object(const void* p);
+#endif
+
+inline static void MarkAsIntentionallyLeaked(const void* ptr) {
+#if defined(_asan_enabled_)
+     __lsan_ignore_object(ptr);
+#else
+     (void)ptr;
+#endif
+}
+
 struct CPyExtFunc_s {
     PyMethodDef md;
     void *direct_fn;
@@ -340,6 +352,7 @@ static PyObject *lib_build_and_cache_attr(LibObject *lib, PyObject *name,
                 PyErr_NoMemory();
                 return NULL;
             }
+            MarkAsIntentionallyLeaked(data);
             ((void(*)(char*))g->address)(data);
         }
         x = convert_to_object(data, ct);