From 4bb85ac54490ffdfa4cd747d06bb401bef69302c Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Wed, 3 Jan 2018 20:29:49 +0000 Subject: Calculate size of buffer instead of using a magic value. Patch by Matthew Davis! Differential Revision: https://reviews.llvm.org/D41421 llvm-svn: 321757 --- clang/lib/Frontend/PrintPreprocessedOutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp') diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 2e023294f1e..36ecdada0c8 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -752,7 +752,7 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, } else if (Tok.isLiteral() && !Tok.needsCleaning() && Tok.getLiteralData()) { OS.write(Tok.getLiteralData(), Tok.getLength()); - } else if (Tok.getLength() < 256) { + } else if (Tok.getLength() < llvm::array_lengthof(Buffer)) { const char *TokPtr = Buffer; unsigned Len = PP.getSpelling(Tok, TokPtr); OS.write(TokPtr, Len); -- cgit v1.2.3