[MOAB-dev] Bug in HomCoord constructor

Vijay S. Mahadevan vijay.m at gmail.com
Fri May 12 20:28:47 CDT 2017


Roman, thanks for raising the issue. Yes, homCoord[1:4] should be
initialized to zero in the constructor. I'll add this change.

Vijay

On Fri, May 12, 2017 at 8:18 PM, putanowr <R.Putanowicz at l5.pk.edu.pl> wrote:
> Hello,
>
> Looking at the code of HomCoord constructor
>
> inline HomCoord::HomCoord(const int coords[], const int num_coords)
> {
>   for (int tmpj = 0; tmpj < num_coords; tmpj++) homCoord[tmpj] =
> coords[tmpj];
>   if (num_coords != 4) homCoord[3] = 1;
> }
>
> I see a bug in it because if called with num_coords < 3 then some
> of homCoord[] are uniinitialized.
>
> The fix is obvious, add a line:
> homCoord[0] = homCoord[1] = homCoord[2] = 0;
>
> Best regards,
>
> Roman
>
> --
> Roman Putanowicz, PhD  < putanowr at l5.pk.edu.pl  >
> Institute for Computational Civil Engng (L-5)
> Dept. of Civil Engng, Cracow Univ. of Technology
> www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034
>
>
>
>


More information about the moab-dev mailing list