View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001787 | OpenFOAM | Bug | public | 2015-07-15 09:40 | 2015-07-15 12:08 |
Reporter | Assigned To | henry | |||
Priority | normal | Severity | block | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | Ubuntu | OS Version | 13.10 |
Summary | 0001787: UList::swap and FixedList::swap are wrong | ||||
Description | the code is wrong Ulist.C line 92 to 99 in function UList::swap List_ACCESS(T, (*this), vp); List_ACCESS(T, a, ap); T tmp; List_FOR_ALL((*this), i) tmp = List_ELEM((*this), vp, i); List_ELEM((*this), vp, i) = List_ELEM(a, ap, i); List_ELEM(a, ap, i) = tmp; List_END_FOR_ALL should be List_ACCESS(T, (*this), vp); List_ACCESS(T, a, ap); T tmp; List_FOR_ALL((*this), i) tmp = List_ELEM((*this), vp, i); --vp; List_ELEM((*this), vp, i) = List_ELEM(a, ap, i); --ap; List_ELEM(a, ap, i) = tmp; List_END_FOR_ALL because #define List_ELEM(f, fp, i) (*fp++) in ListLoopM.H line65 the same to FixedList::swap | ||||
Tags | No tags attached. | ||||
|
Thank you for the bug-report, analysis and proposed fix. Rather than hard-code the pointer decrements, which is not appropriate if the vector machine option is used, I have implemented List_CELEM which returns the current element without incrementing the pointer. This is running fine in OpenFOAM-dev and I will transfer the changes to OpenFOAM-2.4.x shortly and push both. |
|
Resolved by commit 98302e5c5044f473b35cbd50233b941c741dca2a |