diff --git a/lib/Parse/ParsePragma.cpp b/lib/Parse/ParsePragma.cpp index 6d92edb1dfbd..90929d69188e 100644 --- a/lib/Parse/ParsePragma.cpp +++ b/lib/Parse/ParsePragma.cpp @@ -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")) { @@ -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(static_cast((Kind << 16) | Value))); + AnnotTok.setAnnotationValue(reinterpret_cast( + static_cast((Kind << 16) | (Value & 0xFFFF)))); PP.EnterToken(AnnotTok); }