projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d03328
)
[AST/Interp] Fix latent unitialized use of memory bug in D64146
author
Fangrui Song
<i@maskray.me>
Thu, 8 Sep 2022 20:39:30 +0000
(13:39 -0700)
committer
Fangrui Song
<i@maskray.me>
Thu, 8 Sep 2022 20:39:30 +0000
(13:39 -0700)
Exposed by
D132727
: clang/test/AST/Interp/arrays.cpp fails with --config=msan
clang/lib/AST/Interp/Descriptor.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/AST/Interp/Descriptor.cpp
b/clang/lib/AST/Interp/Descriptor.cpp
index 5c1a8a9cf3066f369a896328a82976af721b7af0..2098ae778a87acd8481f68c1a827d9509e7d55d3 100644
(file)
--- a/
clang/lib/AST/Interp/Descriptor.cpp
+++ b/
clang/lib/AST/Interp/Descriptor.cpp
@@
-259,9
+259,7
@@
SourceLocation Descriptor::getLocation() const {
}
InitMap::InitMap(unsigned N) : UninitFields(N) {
- for (unsigned I = 0; I < N / PER_FIELD; ++I) {
- data()[I] = 0;
- }
+ std::fill_n(data(), (N + PER_FIELD - 1) / PER_FIELD, 0);
}
InitMap::T *InitMap::data() {