[ET Trac] [Einstein Toolkit] #1521: Piraha smart_ptr can't handle self assignment

Einstein Toolkit trac-noreply at einsteintoolkit.org
Thu Jan 16 09:34:00 CST 2014

#1521: Piraha smart_ptr can't handle self assignment
  Reporter:  eschnett  |       Owner:  sbrandt            
      Type:  defect    |      Status:  review             
  Priority:  major     |   Milestone:                     
 Component:  Cactus    |     Version:  development version
Resolution:            |    Keywords:                     

Comment (by eschnett):

 The patch is wrong; you need to skip both the clean() and inc() calls.

 I think that "if (this==&s) return *this;" as the first line of operator=
 should work.

 - if this and &s point to the same object, then the assignment operator is
 a no-op, so nothing needs to be done.
 - if the pointers are different, but their guts are the same, then dec/inc
 should not matter since there are at least two pointers.

Ticket URL: <https://trac.einsteintoolkit.org/ticket/1521#comment:5>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit

More information about the Trac mailing list