================ @@ -221,7 +221,24 @@ __tysan_check(void *addr, int size, tysan_type_descriptor *td, int flags) { OldTDPtr -= i; OldTD = *OldTDPtr; - if (!isAliasingLegal(td, OldTD)) + // When shadow memory is set for global objects, the entire object is tagged with the struct type + // This means that when you access a member variable, tysan reads that as you accessing a struct midway + // through, with 'i' being the offset + // Therefore, if you are accessing a struct, we need to find the member type. We can go through the + // members of the struct type and see if there is a member at the offset you are accessing the struct by. + // If there is indeed a member starting at offset 'i' in the struct, we should check aliasing legality + // with that type. If there isn't, we run alias checking on the struct with will give us the correct error. ---------------- jmorse wrote:
```suggestion // with that type. If there isn't, we run alias checking on the struct which will give us the correct error. ``` Doesn't parse without this change? https://github.com/llvm/llvm-project/pull/95387 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits