These places should use dyn_cast instead of cast as they are inside conditionals and have dyn_cast used on them in other places
Details
Details
Diff Detail
Diff Detail
Time | Test | |
---|---|---|
60,040 ms | x64 debian > libFuzzer.libFuzzer::minimize_crash.test Script:
--
: 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/NullDerefTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/minimize_crash.test.tmp-NullDerefTest
|
Event Timeline
Comment Actions
I agree that the call site uses are somewhat problematic, but cast has stronger guarantee. Do you have a test case to trigger a code path that dyn_cast returns nullptr? If not, the if statement should just be replaced with unconditional cast.
llvm/lib/Object/ELFObjectFile.cpp | ||
---|---|---|
802–803 | This can just used cast and delete llvm_unreachable |
llvm/utils/TableGen/DecoderEmitter.cpp | ||
---|---|---|
2111 ↗ | (On Diff #480661) | See the reverted ba59ec2843f99f19d55d7cd9f9ac536fb038fdab: this change seems wrong. |