From 2cc112c33ba46c6f2976337532087143ece5c3a7 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 25 Jun 2012 13:50:22 +0200 Subject: [PATCH] Throwing exception when packet size is negative. --- eo/src/mpi/eoParallelApply.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eo/src/mpi/eoParallelApply.h b/eo/src/mpi/eoParallelApply.h index e401fda6..064396da 100644 --- a/eo/src/mpi/eoParallelApply.h +++ b/eo/src/mpi/eoParallelApply.h @@ -6,7 +6,6 @@ # include # include - template< typename EOT > class ParallelApply : public MpiJob { @@ -32,6 +31,10 @@ class ParallelApply : public MpiJob data( _pop ), packetSize( _packetSize ) { + if ( _packetSize <= 0 ) + { + throw std::runtime_error("Packet size should not be negative."); + } tempArray = new EOT[ packetSize ]; }