[Avida-SVN] r3568 - branches/biounit/source/main

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Fri Dec 18 13:53:32 PST 2009


Author: brysonda
Date: 2009-12-18 16:53:32 -0500 (Fri, 18 Dec 2009)
New Revision: 3568

Modified:
   branches/biounit/source/main/cPopulation.cc
Log:
Properly verify parasite target organism hardware type and instruction set.

Modified: branches/biounit/source/main/cPopulation.cc
===================================================================
--- branches/biounit/source/main/cPopulation.cc	2009-12-18 21:05:22 UTC (rev 3567)
+++ branches/biounit/source/main/cPopulation.cc	2009-12-18 21:53:32 UTC (rev 3568)
@@ -551,7 +551,10 @@
 
   
   // Pre-check target hardware
-  if (target_organism->GetHardware().GetNumThreads() == m_world->GetConfig().MAX_CPU_THREADS.Get()) return false;
+  const cHardwareBase& hw = target_organism->GetHardware();
+  if (hw.GetType() != parent.GetMetaGenome().GetHardwareType() ||
+      hw.GetInstSetID() != parent.GetMetaGenome().GetInstSetID() ||
+      hw.GetNumThreads() == m_world->GetConfig().MAX_CPU_THREADS.Get()) return false;
   
 
   // Handle probabilistic inject failure




More information about the Avida-cvs mailing list