KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator

[Coverity] Potential `nullptr` dereference

Open
#3,179 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
LLVM
Stars
625
Forks
279
Avg merge
3d 5h
Merged PRs (30d)
34

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

Open the contributing guide

Research direction

Start at lib/SPIRV/SPIRVReader.cpp:1109 and review Coverity CID 490176 for the reported potential nullptr dereference. Determine whether the cast is expected to succeed, then inspect nearby tests or translation checks. Done means the reported warning is addressed with behavior consistent with the project’s expectation and relevant checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.