| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
August 08, 2008 [stlsoft] Bug in pod_vector<T, A, SPACE>::pod_vector(class_type const& rhs) | ||||
|---|---|---|---|---|
| ||||
Hi Matthew,
the copy-ctor accesses rhs[0] in
pod_copy_n(begin_(), &rhs[0], size());
If rhs is empty, we get a "Requested index is out of range" assertion. A possible fix is:
if (! rhs.empty()) {
pod_copy_n(begin_(), &rhs[0], size());
}
Is this workaround sufficcient or do I miss something?
I found this bug in 1.9.42 and 1.9.45.
Best regards,
Christian
| ||||
August 09, 2008 Re: [stlsoft] Bug in pod_vector<T, A, SPACE>::pod_vector(class_type const& | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Christian Rössel | Hi Christian
I'm working on this right now. The fix is to change line 489 to
pod_copy_n(begin_(), rhs.begin_(), size());
This has caused me to finally start the release of the new (1.10+) STLSoft unit-testing facility, which you should see available on the site sometime in the next day or so.
Thanks
Matt
Christian Rössel Wrote:
> Hi Matthew,
>
> the copy-ctor accesses rhs[0] in
>
> pod_copy_n(begin_(), &rhs[0], size());
>
> If rhs is empty, we get a "Requested index is out of range" assertion. A possible fix is:
>
> if (! rhs.empty()) {
> pod_copy_n(begin_(), &rhs[0], size());
> }
>
> Is this workaround sufficcient or do I miss something?
> I found this bug in 1.9.42 and 1.9.45.
>
> Best regards,
> Christian
| |||
August 11, 2008 Re: [stlsoft] Bug in pod_vector<T, A, SPACE>::pod_vector(class_type const& | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Christian Rössel | The release of 1.9.46 takes into account this defect (and several others).
Cheers
Matt
Christian Rössel Wrote:
> Hi Matthew,
>
> the copy-ctor accesses rhs[0] in
>
> pod_copy_n(begin_(), &rhs[0], size());
>
> If rhs is empty, we get a "Requested index is out of range" assertion. A possible fix is:
>
> if (! rhs.empty()) {
> pod_copy_n(begin_(), &rhs[0], size());
> }
>
> Is this workaround sufficcient or do I miss something?
> I found this bug in 1.9.42 and 1.9.45.
>
> Best regards,
> Christian
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply