File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,8 +198,9 @@ void ParserWorker::SynchronizeOnDelimiter() {
198198
199199int64_t ParserWorker::NextId (int32_t position) {
200200 int64_t id = next_id_++;
201- if (id > options_.expression_node_limit ) {
201+ if (id > options_.expression_node_limit && !node_limit_exceeded_ ) {
202202 ReportError (position, " expression node limit exceeded" );
203+ node_limit_exceeded_ = true ;
203204 }
204205 if (position >= 0 ) {
205206 positions_.insert ({id, position});
@@ -209,9 +210,7 @@ int64_t ParserWorker::NextId(int32_t position) {
209210
210211int64_t ParserWorker::NextId () { return NextId (-1 ); }
211212
212- bool ParserWorker::NodeLimitExceeded () {
213- return next_id_ > options_.expression_node_limit ;
214- }
213+ bool ParserWorker::NodeLimitExceeded () { return node_limit_exceeded_; }
215214
216215int64_t ParserWorker::CopyId (int64_t id) {
217216 if (id == 0 ) {
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ class ParserWorker {
9898 Token peek_token_;
9999 int recursion_depth_ = 0 ;
100100 int64_t next_id_ = 1 ;
101+ bool node_limit_exceeded_ = false ;
101102 absl::flat_hash_map<int64_t , int32_t > positions_;
102103 std::vector<cel::ParseIssue>* absl_nullable parse_issues_;
103104 int error_count_ = 0 ;
You can’t perform that action at this time.
0 commit comments