Skip to content

Commit 0f309d6

Browse files
committed
Moved call location
1 parent ba242d8 commit 0f309d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler-rt/lib/tysan/tysan.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ static bool isAliasingLegalWithOffset(tysan_type_descriptor *AccessTD,
179179
}
180180

181181
static bool isAliasingLegal(tysan_type_descriptor *TDA,
182-
tysan_type_descriptor *TDB) {
182+
tysan_type_descriptor *TDB,
183+
int OffsetB = 0) {
183184
if (TDA == TDB || !TDB || !TDA)
184185
return true;
185186

@@ -190,7 +191,8 @@ static bool isAliasingLegal(tysan_type_descriptor *TDA,
190191
// TDB may have been adjusted by offset TDAOffset in the caller to point to
191192
// the outer type. Check for aliasing with and without adjusting for this
192193
// offset.
193-
return isAliasingLegalUp(TDA, TDB) || isAliasingLegalUp(TDB, TDA);
194+
return isAliasingLegalUp(TDA, TDB) || isAliasingLegalUp(TDB, TDA) ||
195+
isAliasingLegalWithOffset(TDA, TDB, OffsetB);
194196
}
195197

196198
namespace __tysan {
@@ -267,7 +269,7 @@ __tysan_check(void *addr, int size, tysan_type_descriptor *td, int flags) {
267269
OldTDPtr -= i;
268270
OldTD = *OldTDPtr;
269271

270-
if (!isAliasingLegal(td, OldTD) && !isAliasingLegalWithOffset(td, OldTD, i))
272+
if (!isAliasingLegal(td, OldTD, i))
271273
reportError(addr, size, td, OldTD, AccessStr,
272274
"accesses part of an existing object", -i, pc, bp, sp);
273275

0 commit comments

Comments
 (0)