3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-04 02:10:24 +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-07-23 12:24:14 +12:00
parent c4f685c057
commit 3e8746e78b
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());