View Issue Details

IDProjectCategoryView StatusLast Update
0001000ardourbugspublic2008-11-20 23:48
Reportersimbal Assigned Topaul  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0001000: region.cc amd64 issues
DescriptionThe functions Region::trim_start and Region::trim_to_internal both contain the following code:

long start_shift;
if (new_position > _position) {
    start_shift = new_position - _position;
} else {
    start_shift = -(_position - new_position);
}

The problem here is that _position and new_position are of type jack_nframes_t, which is defined as uint32_t, but start_shift is (at least on amd64) a 64 bit signed integer. The result of the expression -(_position - new_position) is still an unsigned 32 bit integer and therefore not sign extended to 64 bits when it is assigned to start_shift. This leads to garbage results for the region start and makes it impossible to trim regions.

One solution would be to replace that whole if block with
start_shift = (int32_t)(new_position - _position);
TagsNo tags attached.

Activities

paul

2005-06-26 04:12

administrator   ~0002275

start_shift changed to be int32_t in paul's code.
thanks for the report.

Issue History

Date Modified Username Field Change
2005-05-26 01:25 simbal New Issue
2005-06-26 04:12 paul Status new => resolved
2005-06-26 04:12 paul Resolution open => fixed
2005-06-26 04:12 paul Assigned To => paul
2005-06-26 04:12 paul Note Added: 0002275
2008-11-20 23:48 seablade Status resolved => closed