From 741801da75c08ada195b05735f77c5426168d8f9 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 24 Sep 2018 17:51:15 +0000 Subject: Fix the type of 1<<31 integer constants. Shifting into the sign bit is technically undefined behavior. No known compiler exploits it though. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342909 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/SourceManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/clang/Basic') diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index af7dbbc13c..c5a53960b3 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -449,7 +449,7 @@ namespace SrcMgr { } static SLocEntry get(unsigned Offset, const FileInfo &FI) { - assert(!(Offset & (1 << 31)) && "Offset is too large"); + assert(!(Offset & (1u << 31)) && "Offset is too large"); SLocEntry E; E.Offset = Offset; E.IsExpansion = false; @@ -458,7 +458,7 @@ namespace SrcMgr { } static SLocEntry get(unsigned Offset, const ExpansionInfo &Expansion) { - assert(!(Offset & (1 << 31)) && "Offset is too large"); + assert(!(Offset & (1u << 31)) && "Offset is too large"); SLocEntry E; E.Offset = Offset; E.IsExpansion = true; -- cgit v1.2.3