Skip to content

Commit cdc20ab

Browse files
committed
Rephrase warning message
1 parent c2f82d9 commit cdc20ab

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

bolt/lib/Passes/PAuthGadgetScanner.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,10 +1449,13 @@ void FunctionAnalysisContext::findUnsafeUses(
14491449
continue;
14501450

14511451
// Arbitrarily attach the report to the first instruction of BB.
1452-
Reports.push_back(
1453-
make_generic_report(MCInstReference::get(FirstInst, BF),
1454-
"Warning: the function has unreachable basic "
1455-
"blocks (possibly incomplete CFG)"));
1452+
// This is printed as "[message] in function [name], basic block ...,
1453+
// at address ..." when the issue is reported to the user.
1454+
Reports.push_back(make_generic_report(
1455+
MCInstReference::get(FirstInst, BF),
1456+
"Warning: possibly imprecise CFG, the analysis quality may be "
1457+
"degraded in this function. According to BOLT, unreachable code is "
1458+
"found" /* in function [name]... */));
14561459
UnreachableBBReported = true;
14571460
break; // One warning per function.
14581461
}

bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ f_callclobbered_calleesaved:
215215
.globl f_unreachable_instruction
216216
.type f_unreachable_instruction,@function
217217
f_unreachable_instruction:
218-
// CHECK-LABEL: GS-PAUTH: Warning: the function has unreachable basic blocks (possibly incomplete CFG) in function f_unreachable_instruction, basic block {{[0-9a-zA-Z.]+}}, at address
218+
// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function f_unreachable_instruction, basic block {{[0-9a-zA-Z.]+}}, at address
219219
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: add x0, x1, x2
220220
// CHECK-NOT: instructions that write to the affected registers after any authentication are:
221221
b 1f

bolt/test/binary-analysis/AArch64/gs-pauth-calls.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ printed_instrs_nocfg:
14411441
.globl bad_unreachable_call
14421442
.type bad_unreachable_call,@function
14431443
bad_unreachable_call:
1444-
// CHECK-LABEL: GS-PAUTH: Warning: the function has unreachable basic blocks (possibly incomplete CFG) in function bad_unreachable_call, basic block {{[^,]+}}, at address
1444+
// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function bad_unreachable_call, basic block {{[^,]+}}, at address
14451445
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: blr x0
14461446
// CHECK-NOT: instructions that write to the affected registers after any authentication are:
14471447
// CHECK-LABEL: GS-PAUTH: non-protected call found in function bad_unreachable_call, basic block {{[^,]+}}, at address
@@ -1465,7 +1465,7 @@ bad_unreachable_call:
14651465
.type good_unreachable_call,@function
14661466
good_unreachable_call:
14671467
// CHECK-NOT: non-protected call{{.*}}good_unreachable_call
1468-
// CHECK-LABEL: GS-PAUTH: Warning: the function has unreachable basic blocks (possibly incomplete CFG) in function good_unreachable_call, basic block {{[^,]+}}, at address
1468+
// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function good_unreachable_call, basic block {{[^,]+}}, at address
14691469
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1
14701470
// CHECK-NOT: instructions that write to the affected registers after any authentication are:
14711471
// CHECK-NOT: non-protected call{{.*}}good_unreachable_call
@@ -1490,7 +1490,7 @@ good_unreachable_call:
14901490
unreachable_loop_of_bbs:
14911491
// CHECK-NOT: unreachable basic blocks{{.*}}unreachable_loop_of_bbs
14921492
// CHECK-NOT: non-protected call{{.*}}unreachable_loop_of_bbs
1493-
// CHECK-LABEL: GS-PAUTH: Warning: the function has unreachable basic blocks (possibly incomplete CFG) in function unreachable_loop_of_bbs, basic block {{[^,]+}}, at address
1493+
// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function unreachable_loop_of_bbs, basic block {{[^,]+}}, at address
14941494
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: blr x0
14951495
// CHECK-NOT: unreachable basic blocks{{.*}}unreachable_loop_of_bbs
14961496
// CHECK-NOT: non-protected call{{.*}}unreachable_loop_of_bbs

0 commit comments

Comments
 (0)