Fix unused result from sign extending an Offset.
authorStephen Hines <srhines@google.com>
Fri, 16 Sep 2016 07:21:24 +0000 (07:21 +0000)
committerStephen Hines <srhines@google.com>
Fri, 16 Sep 2016 07:21:24 +0000 (07:21 +0000)
Summary:
Offset was doubled in size, but the assignment was missing. We just need
to reassign to the original variable in this case to fix it.

Reviewers: cfe-commits, echristo

Subscribers: meikeb

Differential Revision: https://reviews.llvm.org/D24648

llvm-svn: 281706

clang/lib/Sema/SemaChecking.cpp

index deb3860..1e17afc 100644 (file)
@@ -3882,7 +3882,7 @@ static void sumOffsets(llvm::APSInt &Offset, llvm::APSInt Addend,
   // possible.
   if (Ov) {
     assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too big");
-    Offset.sext(2 * BitWidth);
+    Offset = Offset.sext(2 * BitWidth);
     sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
     return;
   }