]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix wrong assert in notify_ready_to_unpack
authorTimo Heister <timo.heister@gmail.com>
Mon, 4 Aug 2014 19:23:30 +0000 (15:23 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 4 Aug 2014 19:23:30 +0000 (15:23 -0400)
The offset will always be >=4 because we store the CellStatus in the
data sent to p4est in front of the user data. This means the smallest
offset will 4, no matter how much data is attached.

source/distributed/tria.cc

index c1ec69b62e18bf3cc7314791bbf1345095b1e73a..1ed1f9d74de09a57c5d5f6b70904cc27b8b6d088 100644 (file)
@@ -3260,7 +3260,10 @@ namespace parallel
                                                             const CellStatus,
                                                             const void *)> &unpack_callback)
     {
-      Assert (offset < attached_data_size, ExcMessage ("invalid offset in notify_ready_to_unpack()"));
+      Assert (offset >= sizeof(CellStatus), 
+              ExcMessage ("invalid offset in notify_ready_to_unpack()"));
+      Assert (offset < sizeof(CellStatus)+attached_data_size, 
+              ExcMessage ("invalid offset in notify_ready_to_unpack()"));
       Assert (n_attached_datas > 0, ExcMessage ("notify_ready_to_unpack() called too often"));
 
       // Recurse over p4est and hand the caller the data back

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.