Skip to content

Commit

Permalink
Merge pull request #192 from shenhanc78/master
Browse files Browse the repository at this point in the history
Fixed two bugs 1) buildid is not properly read; 2) BBAddressMap.getFunctionAddress causes segfault.
  • Loading branch information
shenhanc78 authored Apr 24, 2024
2 parents 2de2e67 + 36c9f9f commit 1fe2d5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions llvm_propeller_whole_program_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,7 @@ void PropellerWholeProgramInfo::DropNonSelectedFunctions(
for (int i = 0; i != bb_addr_map_.size(); ++i) {
if (selected_functions.contains(i))
continue;
bb_addr_map_[i].BBRanges.clear();
bb_addr_map_[i].BBRanges.shrink_to_fit();
if (!options_.keep_frontend_intermediate_data())
symtab_.erase(bb_addr_map_[i].getFunctionAddress());
symtab_.erase(bb_addr_map_[i].getFunctionAddress());
}
}

Expand Down
3 changes: 1 addition & 2 deletions perfdata_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ template <class ELFT> std::string ELFFileUtil<ELFT>::GetBuildId() {
for (const typename ELFT::Note &note : elf_file_->notes(shdr, err)) {
llvm::StringRef r = note.getName();
if (r == kBuildIdNoteName) {
// Or use shdr.sh_addralign instead of 0?
llvm::ArrayRef<uint8_t> build_id = note.getDesc(/*Align=*/0);
llvm::ArrayRef<uint8_t> build_id = note.getDesc(shdr.sh_addralign);
std::string build_id_str(build_id.size() * 2, '0');
int k = 0;
for (uint8_t t : build_id) {
Expand Down

0 comments on commit 1fe2d5f

Please sign in to comment.