r327735 - [Parser] Remove hard-coded bracket depth limit
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 16 13:17:28 PDT 2018
Author: jkorous
Date: Fri Mar 16 13:17:28 2018
New Revision: 327735
URL: http://llvm.org/viewvc/llvm-project?rev=327735&view=rev
Log:
[Parser] Remove hard-coded bracket depth limit
The diagnostics produced if assert fails are using proper limit from language definition already.
Modified:
cfe/trunk/include/clang/Parse/RAIIObjectsForParser.h
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/include/clang/Parse/RAIIObjectsForParser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/RAIIObjectsForParser.h?rev=327735&r1=327734&r2=327735&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/RAIIObjectsForParser.h (original)
+++ cfe/trunk/include/clang/Parse/RAIIObjectsForParser.h Fri Mar 16 13:17:28 2018
@@ -378,8 +378,6 @@ namespace clang {
}
}
- enum { MaxDepth = 256 };
-
bool diagnoseOverflow();
bool diagnoseMissingClose();
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=327735&r1=327734&r2=327735&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Fri Mar 16 13:17:28 2018
@@ -2250,7 +2250,7 @@ bool BalancedDelimiterTracker::expectAnd
return true;
}
- if (getDepth() < MaxDepth)
+ if (getDepth() < P.getLangOpts().BracketDepth)
return false;
return diagnoseOverflow();
More information about the cfe-commits
mailing list