tlaplus-community / tree-sitter-tlaplus

A tree-sitter grammar for TLA⁺ and PlusCal
MIT License
57 stars 10 forks source link

Fixes crash when encountering QED keyword during error recovery #78

Closed ahelwer closed 1 year ago

ahelwer commented 1 year ago

Fixes #60 Turns out calling std::vector<T>.pop_back() on an empty vector is undefined behavior. In this case, it manifested as the vector size being set to -1 and thus set to the largest possible value size_t, so later attempts to serialize that vector of the entire memory of the computer did not succeed. Yet another reason to love C++! I can't wait for the world to be rid of this stupid language.

ahelwer commented 1 year ago

@susliko you may find this bug humorous