[Avida-SVN] r3186 - development/source/cpu

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Mon Mar 9 08:41:19 PDT 2009


Author: brysonda
Date: 2009-03-09 11:41:18 -0400 (Mon, 09 Mar 2009)
New Revision: 3186

Modified:
   development/source/cpu/cHardwareCPU.cc
Log:
Fix a bug in cHardwareCPU's inject instruction such that it would attempt to access its memory object via un-adjusted heads after it had cut out a section for injection.

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2009-03-09 14:03:23 UTC (rev 3185)
+++ development/source/cpu/cHardwareCPU.cc	2009-03-09 15:41:18 UTC (rev 3186)
@@ -3038,8 +3038,9 @@
   }
   
   // Since its legal to cut out the injected piece, do so.
-  cGenome inject_code( cGenomeUtil::Crop(m_memory, start_pos, end_pos) );
+  cGenome inject_code(cGenomeUtil::Crop(m_memory, start_pos, end_pos));
   m_memory.Remove(start_pos, inject_size);
+  AdjustHeads();
   
   // If we don't have a host, stop here.
   cOrganism * host_organism = m_organism->GetNeighbor();




More information about the Avida-cvs mailing list