]> granicus.if.org Git - clang/commitdiff
Fix undefined behavior that is caused by not always initializing a bool.
authorDaniel Jasper <djasper@google.com>
Thu, 17 Aug 2017 06:33:46 +0000 (06:33 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 17 Aug 2017 06:33:46 +0000 (06:33 +0000)
The fix in r310994 is incomplete, as moveFromAndCancel can set the
pointer without initializing OldIsSpeculativelyEvaluating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp

index 32cb42ea4e078aad02e02beb30629f2cccefce22..041bede6bdc7e981be1d26515e618aed1951285a 100644 (file)
@@ -984,6 +984,7 @@ namespace {
     void moveFromAndCancel(SpeculativeEvaluationRAII &&Other) {
       Info = Other.Info;
       OldStatus = Other.OldStatus;
+      OldIsSpeculativelyEvaluating = Other.OldIsSpeculativelyEvaluating;
       Other.Info = nullptr;
     }