You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2006/10/04 22:30:19 UTC
[jira] Created: (STDCXX-294) std::vector(iterator, size_type,
value_type) corrupts data
std::vector(iterator, size_type, value_type) corrupts data
----------------------------------------------------------
Key: STDCXX-294
URL: http://issues.apache.org/jira/browse/STDCXX-294
Project: C++ Standard Library
Issue Type: Bug
Components: 23. Containers
Affects Versions: 4.1.2, 4.1.3
Environment: all
Reporter: Martin Sebor
Priority: Critical
The program below aborts at runtime:
$ cat t.cpp && make t && ./t
#include <assert.h>
#include <vector>
int main()
{
static const int a[] = { 1, 2, 3, 4, 5 };
std::vector<int> v (a, a + sizeof a / sizeof *a);
v.insert (v.begin () + 2, 2, -1);
static const int b[] = { 1, 2, -1, -1, 3, 4, 5 };
assert (v == std::vector<int>(b, b + sizeof b / sizeof *b));
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
Assertion failed: v == std::vector<int>(b, b + sizeof b / sizeof *b), file t.cpp, line 12
Abort (core dumped)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (STDCXX-294) std::vector(iterator, size_type,
value_type) corrupts data
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/STDCXX-294?page=all ]
Martin Sebor resolved STDCXX-294.
---------------------------------
Fix Version/s: 4.2
Resolution: Fixed
Fixed.
> std::vector(iterator, size_type, value_type) corrupts data
> ----------------------------------------------------------
>
> Key: STDCXX-294
> URL: http://issues.apache.org/jira/browse/STDCXX-294
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 23. Containers
> Affects Versions: 4.1.2, 4.1.3
> Environment: all
> Reporter: Martin Sebor
> Assigned To: Martin Sebor
> Priority: Critical
> Fix For: 4.2
>
>
> The program below aborts at runtime:
> $ cat t.cpp && make t && ./t
> #include <assert.h>
> #include <vector>
> int main()
> {
> static const int a[] = { 1, 2, 3, 4, 5 };
> std::vector<int> v (a, a + sizeof a / sizeof *a);
> v.insert (v.begin () + 2, 2, -1);
> static const int b[] = { 1, 2, -1, -1, 3, 4, 5 };
> assert (v == std::vector<int>(b, b + sizeof b / sizeof *b));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> Assertion failed: v == std::vector<int>(b, b + sizeof b / sizeof *b), file t.cpp, line 12
> Abort (core dumped)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (STDCXX-294) std::vector(iterator, size_type,
value_type) corrupts data
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/STDCXX-294?page=all ]
Martin Sebor reassigned STDCXX-294:
-----------------------------------
Assignee: Martin Sebor
> std::vector(iterator, size_type, value_type) corrupts data
> ----------------------------------------------------------
>
> Key: STDCXX-294
> URL: http://issues.apache.org/jira/browse/STDCXX-294
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 23. Containers
> Affects Versions: 4.1.2, 4.1.3
> Environment: all
> Reporter: Martin Sebor
> Assigned To: Martin Sebor
> Priority: Critical
>
> The program below aborts at runtime:
> $ cat t.cpp && make t && ./t
> #include <assert.h>
> #include <vector>
> int main()
> {
> static const int a[] = { 1, 2, 3, 4, 5 };
> std::vector<int> v (a, a + sizeof a / sizeof *a);
> v.insert (v.begin () + 2, 2, -1);
> static const int b[] = { 1, 2, -1, -1, 3, 4, 5 };
> assert (v == std::vector<int>(b, b + sizeof b / sizeof *b));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> Assertion failed: v == std::vector<int>(b, b + sizeof b / sizeof *b), file t.cpp, line 12
> Abort (core dumped)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira