Skip to content

Commit c4bc996

Browse files
committed
On second thought, just use a deque like everywhere else
Even though '100 nested functions ought to be enough for anybody'...
1 parent aee65d7 commit c4bc996

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

source/cppfront.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -870,21 +870,12 @@ class cppfront
870870
};
871871
class current_functions_
872872
{
873-
std::vector<function_info> list = { {} };
874-
const size_t MaxNestedFunctions = 100; // see the next comment and the assertion:
873+
std::deque<function_info> list = { {} };
875874
public:
876-
current_functions_() {
877-
list.reserve(MaxNestedFunctions); // (1) for pointer stability / lifetime safety
878-
}
879-
880875
auto push(
881876
declaration_node const* decl,
882877
declaration_node::declared_that_funcs thats
883878
) {
884-
assert(
885-
list.size() < MaxNestedFunctions // (2) check that we're not exceeding the limit
886-
&& "ICE: overflowed limit on nested functions - fix by increasing MaxNestedFunctions value"
887-
);
888879
list.emplace_back(decl, thats);
889880
}
890881

0 commit comments

Comments
 (0)