[PATCH] D92846: [KernelAddressSanitizer] Fix globals exclusion for indirect aliases

Marco Elver via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 10 15:28:18 PST 2020


melver added inline comments.


================
Comment at: clang/test/CodeGen/asan-globals-alias.cpp:30
+// KASAN: @aliased_global_2{{.*}} global i32
+// KASAN: @joydev_ids{{.*}} global [1 x {{.*}}i64 1234 }], align 16
 
----------------
nickdesaulniers wrote:
> Do we want to add checks for the aliases: `global_alias_2`, `__global_alias_2_alias`, and `__mod_joydev_ids_device_table`?
I found that depending on optimization level, what the aliases end up aliasing varies (e.g. for the alias-of-alias at -O2 it turns it into an alias to the global_alias_2). Not sure how to best capture this in the test without it becoming flaky. I suppose we could check that the alias somehow references either what was specified directly or the final global, but I don't think that's the job of this test since it's not directly related to ASan or KASAN.

Or did you mean to just check they exist?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92846/new/

https://reviews.llvm.org/D92846



More information about the cfe-commits mailing list