From 8ce9cca118b32604f481ad381eafab25b5798c9f Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Fri, 10 Aug 2012 10:57:52 +0000 Subject: Decrementing std::string::end is not portable, use array access instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161659 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index a66641510a..3ae3c52130 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2636,7 +2636,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { const std::string &S = getModule().getModuleInlineAsm(); if (S.empty()) getModule().setModuleInlineAsm(AsmString); - else if (*--S.end() == '\n') + else if (S.end()[-1] == '\n') getModule().setModuleInlineAsm(S + AsmString.str()); else getModule().setModuleInlineAsm(S + '\n' + AsmString.str()); -- cgit v1.2.3-70-g09d2