[MOAB-dev] r5148 - MOAB/trunk/src
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Thu Sep 1 15:40:32 CDT 2011
Author: kraftche
Date: 2011-09-01 15:40:32 -0500 (Thu, 01 Sep 2011)
New Revision: 5148
Modified:
MOAB/trunk/src/ReorderTool.cpp
Log:
fix bug in ReorderTool where tag data for tags that both a) are variable length and b) contain handles gets corrupted.
Modified: MOAB/trunk/src/ReorderTool.cpp
===================================================================
--- MOAB/trunk/src/ReorderTool.cpp 2011-09-01 20:39:30 UTC (rev 5147)
+++ MOAB/trunk/src/ReorderTool.cpp 2011-09-01 20:40:32 UTC (rev 5148)
@@ -576,7 +576,12 @@
reinterpret_cast<EntityHandle*>(&buffer2[0]),
buffer.size() / sizeof(EntityHandle) );
CHKERR;
- buffer.swap(buffer2);
+ // if var-length tag then do not do swap because pointers[] contains pointers
+ // into old buffer
+ if (-1 == tagsize)
+ memcpy( &buffer[0], &buffer2[0], buffer.size() );
+ else
+ buffer.swap(buffer2);
}
// store re-orederd tag data
More information about the moab-dev
mailing list