View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0004811 | ardour | bugs | public | 2012-04-04 23:29 | 2020-04-19 20:16 |
| Reporter | ahurst | Assigned To | cth103 | ||
| Priority | normal | Severity | major | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Product Version | 3.0-beta3 | ||||
| Target Version | 3.0 | ||||
| Summary | 0004811: Using local variable pointer outside of scope (2) | ||||
| Description | High impact static analysis bug: This one is a little trickier than the previous. It requires going around the loop once. In gtk2_ardour/playlist_selector.cc:209: Using "selected_row", which points to an out-of-scope local variable "child_row". The pointer is no longer valid. | ||||
| Additional Information | 198 for (list<boost::shared_ptr<Playlist> >::iterator p = unassigned.begin(); p != unassigned.end(); ++p) { 199 TreeModel::Row child_row; 200 201 child_row = *(model->append (row.children())); 202 child_row[columns.text] = (*p)->name(); 203 child_row[columns.playlist] = *p; 204 *** First time: Condition "*p == boost::shared_ptr<ARDOUR::Playlist>(this_track->playlist())", taking true branch *** Second time: Condition "*p == boost::shared_ptr<ARDOUR::Playlist>(this_track->playlist())", taking false branch 205 if (*p == this_track->playlist()) { *** First time: Assigning: "selected_row" = "&child_row" (address of local variable "child_row"). 206 selected_row = &child_row; 207 } 208 *** Second time: Pointer to local outside scope. Using "selected_row", which points to an out-of-scope variable "child_row". 209 if (selected_row != 0) { 210 tree.get_selection()->select (*selected_row); 211 } *** Variable "child_row" goes out of scope. *** Jumping back to the beginning of the loop 212 } | ||||
| Tags | No tags attached. | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-04-04 23:29 | ahurst | New Issue | |
| 2012-04-05 01:12 | cth103 | cost | => 0.00 |
| 2012-04-05 01:12 | cth103 | Target Version | => 3.0 beta4 |
| 2012-04-07 01:54 | cth103 | Note Added: 0013087 | |
| 2012-04-07 01:54 | cth103 | Status | new => resolved |
| 2012-04-07 01:54 | cth103 | Resolution | open => fixed |
| 2012-04-07 01:54 | cth103 | Assigned To | => cth103 |
| 2012-05-23 15:08 | cth103 | Target Version | 3.0 beta4 => 3.0 |
| 2020-04-19 20:16 | system | Note Added: 0023020 | |
| 2020-04-19 20:16 | system | Status | resolved => closed |