This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/50610] G++ 4.4.3: Incorrect code at -O2 (-fwrapv, SafeInt, c++ templates, template class files)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50610

--- Comment #2 from Jeffrey Walton <noloader at gmail dot com> 2011-10-04 05:24:20 UTC ---
For this problem, the work around was:

   try
   {
     const T* base = ptr;
     base += SafeInt<size_t>(cnt);
   }
   catch(const SafeIntException&)
   {
     throw InvalidArgumentException("Array pointer wrap");
   }

It seems LeBlanc had it all the time, but I was not using it. My apologies.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]