Skip to content

lldb/source/Utility/Scalar.cpp:756: Condition can never be true #85985

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

Closed
dcb314 opened this issue Mar 20, 2024 · 5 comments · Fixed by #94775
Closed

lldb/source/Utility/Scalar.cpp:756: Condition can never be true #85985

dcb314 opened this issue Mar 20, 2024 · 5 comments · Fixed by #94775

Comments

@dcb314
Copy link

dcb314 commented Mar 20, 2024

lldb/source/Utility/Scalar.cpp:756:23: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]

Source code is

if (sign_bit_pos < max_bit_pos) {
switch (m_type) {
case Scalar::e_void:
case Scalar::e_float:
return false;

case Scalar::e_int:
  if (max_bit_pos == sign_bit_pos)
    return true;
@llvmbot
Copy link
Member

llvmbot commented Mar 20, 2024

@llvm/issue-subscribers-lldb

Author: None (dcb314)

lldb/source/Utility/Scalar.cpp:756:23: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]

Source code is

if (sign_bit_pos < max_bit_pos) {
switch (m_type) {
case Scalar::e_void:
case Scalar::e_float:
return false;

case Scalar::e_int:
  if (max_bit_pos == sign_bit_pos)
    return true;

@dcb314
Copy link
Author

dcb314 commented May 6, 2024

git blame says:

99b5474 (Jonas Hahnfeld 2023-08-01 18:31:51 +0200 756) if (max_bit_pos == sign_bit_pos)
^99b5474310 (Jonas Hahnfeld 2023-08-01 18:31:51 +0200 757) return true;

@hahnjo
Copy link
Member

hahnjo commented May 6, 2024

This is 100% bogus: If you click on the commit, you will see that it only added a Clang test. Do you maybe only have a shallow clone without the full history?

@dcb314
Copy link
Author

dcb314 commented May 6, 2024

This is 100% bogus:

Agreed.

If you click on the commit, you will see that it only added a Clang test.

Agreed.

Do you maybe only have a shallow clone without the full history?

Maybe I do. I have had trouble with shallow clones and git blame finding
the wrong commit in the past.

Do you perhaps know who the real author of the code was ?

@hahnjo
Copy link
Member

hahnjo commented May 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants