[Avida-SVN] r2817 - branches/hjg-dev/source/cpu

hjg at myxo.css.msu.edu hjg at myxo.css.msu.edu
Tue Oct 7 19:08:24 PDT 2008


Author: hjg
Date: 2008-10-07 22:08:24 -0400 (Tue, 07 Oct 2008)
New Revision: 2817

Modified:
   branches/hjg-dev/source/cpu/cHardwareCPU.cc
Log:
fixed bug in get neighbor's opinion instruction

Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-10-08 02:07:33 UTC (rev 2816)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc	2008-10-08 02:08:24 UTC (rev 2817)
@@ -6683,7 +6683,7 @@
   // Get faced neighbor
   cOrganism * neighbor = organism->GetNeighbor();
   
-  if(neighbor->HasOpinion()) {
+  if(neighbor != NULL && neighbor->HasOpinion()) {
     const int opinion_reg = FindModifiedRegister(REG_BX);
     const int age_reg = FindNextRegister(opinion_reg);
   




More information about the Avida-cvs mailing list