llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.36k stars 12.14k forks source link

[clang static analyzer] some confusion regarding the ipa-always-inline-size parameter #106963

Open tianxinghe opened 2 months ago

tianxinghe commented 2 months ago

I created null pointer dereference defects for each of the functions: func0, func1, func2, func3, and func4. Additionally, the main function does not call func1, yet the CSA checker only reported the defects in func1.I am unsure what caused this issue, perhaps there is a flaw hidden within the checker.

This issue has persisted from LLVM 9 through LLVM 18.
https://godbolt.org/z/4fcWYqfj9

4804:20: warning: Dereference of undefined pointer value (loaded from variable 'llvm_cbe_ld461') [core.NullDereference] 4804 | llvm_cbe_ld462 = *llvm_cbe_ld461; | ^~~~~~~~~~~~~~~

llvmbot commented 2 months ago

@llvm/issue-subscribers-clang-static-analyzer

Author: Tianxing He (tianxinghe)

I created null pointer dereference defects for each of the functions: func0, func1, func2, func3, and func4. Additionally, the main function does not call func1, yet the CSA checker only reported the defects in func1.I am unsure what caused this issue, perhaps there is a flaw hidden within the checker. This issue has persisted from LLVM 9 through LLVM 18. https://godbolt.org/z/4fcWYqfj9 `4804:20: warning: Dereference of undefined pointer value (loaded from variable 'llvm_cbe_ld461') [core.NullDereference] 4804 | llvm_cbe_ld462 = *llvm_cbe_ld461; | ^~~~~~~~~~~~~~~`