From ecb09aa2e11b05b11c630f9fa9328966a770e167 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 15 Jun 2020 16:30:52 -0700 Subject: [PATCH] Fix bounds check bug. --- core/FCV.hpp | 2 +- core/Tests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/FCV.hpp b/core/FCV.hpp index 0d6592985..af730f54c 100644 --- a/core/FCV.hpp +++ b/core/FCV.hpp @@ -151,7 +151,7 @@ public: { if (likely(_s < C)) new(reinterpret_cast(_m) + _s++) T(v); - throw Utils::OutOfRangeException; + else throw Utils::OutOfRangeException; } /** diff --git a/core/Tests.cpp b/core/Tests.cpp index 383f4e4fc..f87f2e586 100644 --- a/core/Tests.cpp +++ b/core/Tests.cpp @@ -430,7 +430,7 @@ extern "C" const char *ZTT_general() } test.clear(); test2.clear(); - if (cnt != (long)test.size()) { + if ((cnt != (long)test.size()) && (cnt != 0)) { ZT_T_PRINTF("FAILED (expected 0 objects, got %lu (5))" ZT_EOL_S,cnt); return "FCV object life cycle test failed (5)"; }