Skip to content

Commit

Permalink
Per #3075, update TrackInfo::diag_name() to return a string rather th…
Browse files Browse the repository at this point in the history
…an a pointer to temporary memory to solve the problem with diagnostic names in unit_tc_pairs.xml when compiled with optimization enabled.
  • Loading branch information
JohnHalleyGotway committed Feb 4, 2025
1 parent d253902 commit da36296
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libcode/vx_tc_util/track_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ int TrackInfo::warm_core_dur() const {

////////////////////////////////////////////////////////////////////////

const char * TrackInfo::diag_name(int i) const {
return(i>=0 && i<DiagName.n() ? DiagName[i].c_str() : na_str);
const string TrackInfo::diag_name(int i) const {
return(i>=0 && i<DiagName.n() ? DiagName[i] : na_str);
}

////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/libcode/vx_tc_util/track_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class TrackInfo {
const ConcatString & field_source() const;
int n_diag() const;
const StringArray & diag_name() const;
const char * diag_name(int) const;
const std::string diag_name(int) const;

StringArray track_lines() const;

Expand Down

0 comments on commit da36296

Please sign in to comment.