Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1461 closed Bugs (fixed)

multi_array::resize index error

Reported by: wasti.redl@… Owned by: Ronald Garcia
Milestone: To Be Determined Component: multi_array
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

multi_array::resize wants to copy the old data to the new. However, it confuses the old and new arrays when calculating the indices for the subviews. As a result, creating the view asserts.

Minimal crashing example:

#include <boost/multi_array.hpp>

int main() {

typedef boost::multi_array<int, 1> ar_t; typedef ar_t::extent_range range; ar_t ar; ar.resize(boost::extents[range(-3, 3)]);

}

The attached patched solves the problem.

Attachments (1)

multi_array.patch (953 bytes ) - added by wasti.redl@… 15 years ago.
Patch that solves the bug.

Download all attachments as: .zip

Change History (3)

by wasti.redl@…, 15 years ago

Attachment: multi_array.patch added

Patch that solves the bug.

comment:1 by Ronald Garcia, 15 years ago

Resolution: fixed
Status: newclosed

(In [41257]) Fixes #1461

comment:2 by Eric Niebler, 15 years ago

(In [41268]) Merged revisions 41247-41267 via svnmerge from https://svn.boost.org/svn/boost/trunk

........

r41249 | schoepflin | 2007-11-20 01:07:05 -0800 (Tue, 20 Nov 2007) | 2 lines

Fixed SNAFU caused by last checkin.

........

r41251 | johnmaddock | 2007-11-20 03:12:36 -0800 (Tue, 20 Nov 2007) | 1 line

aCC on PA-RISC emits hard errors if a numeric constant underflows: enable existing workaround for that compiler.

........

r41252 | johnmaddock | 2007-11-20 03:18:48 -0800 (Tue, 20 Nov 2007) | 1 line

Changed order of #includes to keep Borland C++ 5.5.1 happy.

........

r41253 | hkaiser | 2007-11-20 03:20:47 -0800 (Tue, 20 Nov 2007) | 1 line

Wave: Suppressed MS warning for tests.

........

r41254 | johnmaddock | 2007-11-20 03:40:28 -0800 (Tue, 20 Nov 2007) | 4 lines

Added missing #include. Fix warnings on MSVC: the code should now be clean with -W4. Fix warnings on gcc: the code should now be clean with -Wall -Wshadow. This fixes Track issues #585, #980, #1196, #1278 and #1340.

........

r41256 | garcia | 2007-11-20 07:56:29 -0800 (Tue, 20 Nov 2007) | 3 lines

Added a simple test that changes index bases while resizing (thanks to wasti.redl@… for this code, which caught a bug).

........

r41257 | garcia | 2007-11-20 07:56:51 -0800 (Tue, 20 Nov 2007) | 2 lines

Fixes #1461

........

r41258 | eric_niebler | 2007-11-20 08:52:43 -0800 (Tue, 20 Nov 2007) | 1 line

fix warning in gcc-4.3

........

r41259 | johnmaddock | 2007-11-20 08:57:32 -0800 (Tue, 20 Nov 2007) | 1 line

Added warning suppression for VC-9.

........

r41260 | grafik | 2007-11-20 09:51:21 -0800 (Tue, 20 Nov 2007) | 1 line

Allow indication of the Boost.Build location with an argument. This allows to override the built-in BB when testing.

........

r41262 | bgubenko | 2007-11-20 10:51:04 -0800 (Tue, 20 Nov 2007) | 1 line

fixed markup validation error: consolidated two consequtive notes

........

r41263 | bgubenko | 2007-11-20 11:09:33 -0800 (Tue, 20 Nov 2007) | 1 line

mark some function_types and serialization library tests for acc toolset

........

Note: See TracTickets for help on using tickets.