Skip to content

Commit 00e509a

Browse files
committed
Revert the change of RegionStore.cpp in commit 03004d9.
1 parent ff376d1 commit 00e509a

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

clang/lib/StaticAnalyzer/Core/RegionStore.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,20 +2122,8 @@ SVal RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
21222122
if (const std::optional<SVal> &V = B.getDirectBinding(R))
21232123
return *V;
21242124

2125-
// UnnamedBitField is always Undefined unless using memory operation such
2126-
// as 'memset'.
2127-
// For example, for code
2128-
// typedef struct {
2129-
// int i :2;
2130-
// int :30; // unnamed bit-field
2131-
// } A;
2132-
// A a = {1};
2133-
// The bits of the unnamed bit-field in local variable a can be anything.
2134-
const FieldDecl *FD = R->getDecl();
2135-
if (FD->isUnnamedBitField())
2136-
return UndefinedVal();
2137-
21382125
// If the containing record was initialized, try to get its constant value.
2126+
const FieldDecl *FD = R->getDecl();
21392127
QualType Ty = FD->getType();
21402128
const MemRegion* superR = R->getSuperRegion();
21412129
if (const auto *VR = dyn_cast<VarRegion>(superR)) {

0 commit comments

Comments
 (0)