Skip to content

Commit

Permalink
Fix uninitialized read in vtordisp pragma code.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201280 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rnk committed Feb 13, 2014
1 parent 854ec99 commit 26c70bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Parse/ParsePragma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
}


uint64_t Value;
uint64_t Value = 0;
if (Kind == Sema::PVDK_Push || Kind == Sema::PVDK_Set) {
const IdentifierInfo *II = Tok.getIdentifierInfo();
if (II && II->isStr("off")) {
Expand Down Expand Up @@ -998,8 +998,8 @@ void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
AnnotTok.startToken();
AnnotTok.setKind(tok::annot_pragma_ms_vtordisp);
AnnotTok.setLocation(VtorDispLoc);
AnnotTok.setAnnotationValue(
reinterpret_cast<void *>(static_cast<uintptr_t>((Kind << 16) | Value)));
AnnotTok.setAnnotationValue(reinterpret_cast<void *>(
static_cast<uintptr_t>((Kind << 16) | (Value & 0xFFFF))));
PP.EnterToken(AnnotTok);
}

Expand Down

0 comments on commit 26c70bc

Please sign in to comment.