From 5f96802aec23e60d2fc34bb977d97012cd15c4fe Mon Sep 17 00:00:00 2001
From: Daniel Jasper <djasper@google.com>
Date: Thu, 17 Aug 2017 06:33:46 +0000
Subject: [PATCH] Fix undefined behavior that is caused by not always
 initializing a bool.

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 32cb42ea4e0..041bede6bdc 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -984,6 +984,7 @@ namespace {
     void moveFromAndCancel(SpeculativeEvaluationRAII &&Other) {
       Info = Other.Info;
       OldStatus = Other.OldStatus;
+      OldIsSpeculativelyEvaluating = Other.OldIsSpeculativelyEvaluating;
       Other.Info = nullptr;
     }
 
-- 
GitLab