3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-12 06:00:55 +00:00

log_help: Fix mem leaks

`_content` vector owns elements so that when the `ContentListing` is deleted so is the content.
Remove `get_content()` method in favour of `begin()` and `end()` const iterators.
More `const` in general, and iterations over `ContentListing` use `&content` to avoid copying data.
This commit is contained in:
Krystine Sherwin 2025-08-06 13:52:12 +12:00
parent 3959d19291
commit 7fe4ae45fd
No known key found for this signature in database
3 changed files with 31 additions and 36 deletions

View file

@ -923,8 +923,8 @@ struct HelpPass : public Pass {
json.name(name.c_str()); json.begin_object();
json.entry("title", title);
json.name("content"); json.begin_array();
for (auto content : cmd_help.get_content())
json.value(content->to_json());
for (auto &content : cmd_help)
json.value(content.to_json());
json.end_array();
json.entry("group", cmd_help.group);
json.entry("source_file", pass->location.file_name());