[PATCH] D24648: Fix unused result from sign extending an Offset.

Stephen Hines via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 23:43:19 PDT 2016


srhines created this revision.
srhines added a reviewer: cfe-commits.
srhines added a subscriber: meikeb.

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.

https://reviews.llvm.org/D24648

Files:
  lib/Sema/SemaChecking.cpp

Index: lib/Sema/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp
+++ lib/Sema/SemaChecking.cpp
@@ -3882,7 +3882,7 @@
   // 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;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24648.71598.patch
Type: text/x-patch
Size: 442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160916/f9910362/attachment.bin>


More information about the cfe-commits mailing list