From 1d7c981a6d9c26ac87dee97419eef40d78c004ad Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Sun, 12 Mar 2006 20:09:50 +0000 Subject: [PATCH] add patch for range checking of std::vector[] git-svn-id: https://svn.dealii.org/trunk@12577 0785d39b-7218-0410-832d-ea1e28bc413d --- .../patches/gcc-4.0.0-stl_vector.h.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch diff --git a/deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch b/deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch new file mode 100644 index 0000000000..8f6b3216e8 --- /dev/null +++ b/deal.II/contrib/patches/gcc-4.0.0-stl_vector.h.patch @@ -0,0 +1,46 @@ +*** stl_vector.h 2005-10-17 18:15:32.000000000 +0200 +--- stl_vector.orig.h 2005-10-10 21:30:22.000000000 +0200 +*************** +*** 492,503 **** + */ + reference + operator[](size_type __n) +! { +! #ifdef STL_DEBUG +! if (__n >= this->size()) abort(); +! #endif +! return *(begin() + __n); +! } + + /** + * @brief Subscript access to the data contained in the %vector. +--- 492,498 ---- + */ + reference + operator[](size_type __n) +! { return *(begin() + __n); } + + /** + * @brief Subscript access to the data contained in the %vector. +*************** +*** 512,523 **** + */ + const_reference + operator[](size_type __n) const +! { +! #ifdef STL_DEBUG +! if (__n >= this->size()) abort(); +! #endif +! return *(begin() + __n); +! } + + protected: + /// @if maint Safety check used only from at(). @endif +--- 507,513 ---- + */ + const_reference + operator[](size_type __n) const +! { return *(begin() + __n); } + + protected: + /// @if maint Safety check used only from at(). @endif -- 2.39.5