Skip to content

Commit

Permalink
Address coderabbit feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Nov 23, 2024
1 parent 903421e commit 2c5c1b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/asm_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ vector<raw_program> read_elf(std::istream& input_stream, const std::string& path

// Now that we've incorporated any subprograms from other sections, we can narrow the list
// to return to just those programs in the desired section, if any.
if (!desired_section.empty()) {
if (!desired_section.empty() && !res.empty()) {
for (int index = res.size() - 1; index >= 0; index--) {
if (res[index].section_name != desired_section) {
res.erase(res.begin() + index);
Expand Down
3 changes: 3 additions & 0 deletions src/spec_type_descriptors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ struct raw_program {
std::string function_name{};
std::vector<ebpf_inst> prog{};
program_info info{};

// Track whether subprograms for this raw_program have been resolved,
// preventing duplicate resolution when multiple programs exist in a section.
bool resolved_subprograms{};
};

Expand Down

0 comments on commit 2c5c1b7

Please sign in to comment.