View Issue Details

IDProjectCategoryView StatusLast Update
0004811ardourbugspublic2020-04-19 20:16
Reporterahurst Assigned Tocth103  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version3.0-beta3 
Target Version3.0 
Summary0004811: Using local variable pointer outside of scope (2)
DescriptionHigh 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 Information198 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 }
TagsNo tags attached.

Activities

cth103

2012-04-07 01:54

administrator   ~0013087

SVN 11809.

system

2020-04-19 20:16

developer   ~0023020

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

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