Skip to content

Commit 3e24991

Browse files
committed
More format changes
1 parent 6f79545 commit 3e24991

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

compiler-rt/lib/tysan/tysan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static bool isAliasingLegalUp(tysan_type_descriptor *TDA,
133133
// partially inside the last type
134134
if (TDA->Struct.Members[Idx].Offset > OffsetA)
135135
Idx -= 1;
136-
136+
137137
OffsetA -= TDA->Struct.Members[Idx].Offset;
138138
TDA = TDA->Struct.Members[Idx].Type;
139139
} else {

compiler-rt/test/tysan/struct-offset-different-base.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@
66
#include <stdio.h>
77

88
struct inner {
9-
char buffer;
10-
int i;
9+
char buffer;
10+
int i;
1111
};
1212

13-
void init_inner(inner *iPtr) {
14-
iPtr->i = 200;
15-
}
13+
void init_inner(inner *iPtr) { iPtr->i = 200; }
1614

1715
struct outer {
18-
inner foo;
19-
char buffer;
16+
inner foo;
17+
char buffer;
2018
};
2119

2220
int main(void) {
23-
outer *l = new outer();
24-
25-
init_inner(&l->foo);
26-
27-
int access_offsets_with_different_base = l->foo.i;
28-
printf("Accessed value is %d\n", access_offsets_with_different_base);
29-
30-
return 0;
21+
outer *l = new outer();
22+
23+
init_inner(&l->foo);
24+
25+
int access_offsets_with_different_base = l->foo.i;
26+
printf("Accessed value is %d\n", access_offsets_with_different_base);
27+
28+
return 0;
3129
}
3230

3331
// CHECK: Accessed value is 200

0 commit comments

Comments
 (0)