Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC][asan] Use %p to print addresses #98575

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler-rt/lib/asan/asan_descriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static void DescribeAddressRelativeToGlobal(uptr addr, uptr access_size,
str.AppendF(" global variable '%s' defined in '",
MaybeDemangleGlobalName(g.name));
PrintGlobalLocation(&str, g, /*print_module_name=*/false);
str.AppendF("' (0x%zx) of size %zu\n", g.beg, g.size);
str.AppendF("' (%p) of size %zu\n", (void *)g.beg, g.size);
str.Append(d.Default());
PrintGlobalNameIfASCII(&str, g);
Printf("%s", str.data());
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/asan/asan_rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void PrintAddressSpaceLayout() {

Printf("SHADOW_SCALE: %d\n", (int)ASAN_SHADOW_SCALE);
Printf("SHADOW_GRANULARITY: %d\n", (int)ASAN_SHADOW_GRANULARITY);
Printf("SHADOW_OFFSET: 0x%zx\n", (uptr)ASAN_SHADOW_OFFSET);
Printf("SHADOW_OFFSET: %p\n", (void *)ASAN_SHADOW_OFFSET);
CHECK(ASAN_SHADOW_SCALE >= 3 && ASAN_SHADOW_SCALE <= 7);
if (kMidMemBeg)
CHECK(kMidShadowBeg > kLowShadowEnd &&
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/asan/TestCases/debug_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// printed because of verbosity=1
// CHECK: SHADOW_SCALE: [[SCALE:[0-9]+]]
// CHECK: SHADOW_OFFSET: [[OFFSET:0x[0-9a-f]+]]
// CHECK: SHADOW_OFFSET: 0x{{0*}}[[OFFSET:[0-9a-f]+]]

int main() {
size_t scale, offset;
Expand All @@ -24,7 +24,7 @@ int main() {
fprintf(stderr, "offset: 0x" PTR "\n", (void*)offset);

// CHECK: scale: [[SCALE]]
// CHECK: offset: [[OFFSET]]
// CHECK: offset: 0x{{0*}}[[OFFSET]]

return 0;
}
Loading