Open jtb20 opened 2 months ago
Thank you for finding this! It looks like we have an arbitrary limit here for some reason, I will fix it
I worked around this, in this commit:
http://op.oilshell.org/uuu/github-jobs/7900/
in case you want to get some work done ... But I guess there is also the workaround of using setvar
on the dict
The underlying issue is having a large dict literal, and a hard-coded limit in our pgen2 parser generator
which is due to an interaction between the GC and std::vector
pointer invalidation on resizing -- so we enforce that it doesn't resize, which means it must be fixed
I am thinking about which other data structure to switch to! to make it arbitrary size
Thank you for the quick response! I'll apply one or the other workaround for the time being.
(std::deque maybe?)
Oh yeah I didn't realize std::deque
doesn't invalidate, so it's true it could be used
But I am just implementing a tiny subset of it, which is basically a linked list of pieces/chunks
Eventually I want to get rid of the libstdc++
dependency, like fish shell does, because we only use a few simple things (mainly std::vector
), and the extra shared library isn't trivial
Hm that was a good suggestion, it just worked with a tiny change
https://op.oilshell.org/uuu/github-jobs/7901/
My own "simple" linked array arena didn't work, and also I realize I don't really know how to implement the equivalent of emplace_back() for it :-/
I will look at the performance and code size for std::deque and see if we want to keep it ... the source code is certainly short :)
This testcase crashes ysh 0.23.0:
It crashes here:
I've not debugged further than that.