KhronosGroup/SPIRV-LLVM-Translator

[Coverity] Potential `nullptr` dereference

Open

#3,179 opened on May 16, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)LLVM (270 forks)auto 404
buggood first issue

Repository metrics

Stars
 (616 stars)
PR merge metrics
 (PR metrics pending)

Description

See details at https://scan.coverity.com/projects/intel-llvm?tab=overview as CID 490176:

https://github.com/KhronosGroup/SPIRV-LLVM-Translator/blob/590068b12402262dd9bd0aa1386f2e89babfa8a1/lib/SPIRV/SPIRVReader.cpp#L1109

If we don't expect the cast to fail, then we should use cast instead of dyn_cast. The former contains an assertion instead of runtime check

Contributor guide