永遠不會執行該指令。
周圍的代碼使該指令永遠不會被執行。
示例:第二個 if 指令的條件不可能得到滿足。這需要變量 s 為非 null 變量,且僅在可以將 s 指定為非 null 值的路徑時,存在 return 指令。
String s = null;
if (b) {
s = "Yes";
return;
}
if (s != null) {
Dead();
}
[1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3050 CAT II
[2] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3050 CAT II
[3] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 561