From: Stephen Hines Date: Fri, 16 Sep 2016 07:21:24 +0000 (+0000) Subject: Fix unused result from sign extending an Offset. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4941367dd8c8749bddb5e571c41f3e33287d0d12;p=clang Fix unused result from sign extending an Offset. 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281706 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index deb3860da1..1e17afc06b 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -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; }