[PATCH][libstdc++-v3 parallel mode] Avoid taking address of dereferenced random access iterator

Johannes Singler singler@kit.edu
Thu Mar 10 09:48:00 GMT 2011


The attached patch patch solves a conformance problem of the parallel 
mode helper routine multiseq_partition.  I have added a test case for 
that.  multiseq_selection has similar problems, but is unused, so I plan 
to remove that completely (which might ask for renaming of the file and 
the test).

Should I use unique_ptr (or alloca, or something similar) here for a 
better exception safety (this routine is not parallel itself)?
Is it the appropriate place for the "unit test"?  It is used in the 
parallel sort.

Tested x86_64-unknown-linux-gnu: No regressions


2011-03-10  Johannes Singler  <singler@kit.edu>

         * include/parallel/multiseq_selection.h (multiseq_partition):
         Copy-construct _ValueType element on demand on heap, do not
         take address of dereferenced random access iterator.
         Remove unused code that has the same problem.
         * testsuite/25_algorithms/sort/multiseq_selection.cc:
         New unit test for multiseq_partition.

Johannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: multiseq_no_reference.patch
Type: text/x-patch
Size: 6938 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110310/3b7e769f/attachment.bin>


More information about the Gcc-patches mailing list