diff options
| author | nagachika <nagachika@ruby-lang.org> | 2023-08-13 13:21:30 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2023-08-13 13:21:30 +0900 |
| commit | 6898389a0f640c4155a7073579f43d1e16893698 (patch) | |
| tree | 5de77c056251d4161120354da7ba891dfa9cad9f /test/ruby | |
| parent | ead1a83b2f5951cd09667ed2722ab14b9bcf0834 (diff) | |
merge revision(s) 5bc8fceca8d47ed1ef9c603c6531a408de36b60c: [Backport #19835]
Fix memory leak in parser for incomplete tokens
[Bug #19835]
The parser does not free the `tbl` of the `struct vtable` when there are
leftover `lvtbl` in the parser. This causes a memory leak.
The following script reproduces this issue:
```
10.times do
100_000.times do
Ripper.parse("class Foo")
end
puts `ps -o rss= -p #{$$}`
end
```
---
parse.y | 42 ++++++++++++++++++++++++++++--------------
test/ripper/test_ripper.rb | 7 +++++++
2 files changed, 35 insertions(+), 14 deletions(-)
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions
