[Developers] admb bug

Johnoel Ancheta johnoel at hawaii.edu
Mon Mar 10 13:56:13 PDT 2014


See
http://www.admb-project.org/redmine/projects/issues/repository/revisions/1772


On Sun, Mar 9, 2014 at 5:37 PM, dave fournier <davef at otter-rsch.com> wrote:

>
> I noticed that the subvector operator for dvectors does not
> check to see that the index bounds for the subvector are valid.
> This should fix the problem. code is in dvector.cpp
>
>
> dvector::dvector(_CONST predvector& pdv)
>  {
>    shape=pdv.p->shape;
>    if (shape)
>    {
>      (shape->ncopies)++;
>    }
>    else
>    {
>      cerr << "Taking a subvector  of an unallocated dvector"<<endl;
>    }
>    v = pdv.p->v;
>    int mmin=pdv.p->indexmin();
>    int mmax=pdv.p->indexmax();
>    if (pdv.lb<mmin || pdv.ub> mmax)
>    {
>      cerr << "index out of bounds in dvector subvector operator" << endl;
>      ad_exit(1);
>    }
>    index_min=pdv.lb;
>    index_max=pdv.ub;
>  }
>
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/developers/attachments/20140310/56009328/attachment.html>


More information about the Developers mailing list