llvm / llvm/llvm-project

[OpenMP] ElementTypeSize may be used uninitialized

Open
#181,075 2 comments 0 reactions 0 assignees View on GitHub
clang:codegen clang:openmp code-quality
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Static analysis flagged this line:

https://github.com/llvm/llvm-project/blob/2ada4b8fb0914ebdddc386130db24bcc074b3554/clang/lib/CodeGen/CGOpenMPRuntime.cpp#L8532-L8533

because it looks like `ElementTypeSize` could be uninitialized in some cases.

It looks like this was brought in by 0cab911

I can't tell all the assumptions here but it could not prove to myself it has to be initialized.

CC @chichunchen @alexey-bataev @zahiraam

Contributor guide

Open the contributing guide

Research direction

Start in clang/lib/CodeGen/CGOpenMPRuntime.cpp around lines 8532-8533 and trace the control flow that assigns ElementTypeSize, including the change introduced by commit 0cab911. Determine whether every path initializes it and document or correct the issue so the static-analysis concern is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.