From 403d11fcfc8686ce4670f2c42813f869678b0e52 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 26 Jun 2009 22:31:49 +0000 Subject: In isInline() don't try to take address of a vector w/o storage yet; fixes QPID-1960 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@788893 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/InlineVector.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpp/src') diff --git a/cpp/src/tests/InlineVector.cpp b/cpp/src/tests/InlineVector.cpp index bcd36e47b4..009f10af9d 100644 --- a/cpp/src/tests/InlineVector.cpp +++ b/cpp/src/tests/InlineVector.cpp @@ -30,6 +30,10 @@ using namespace std; typedef InlineVector Vec; bool isInline(const Vec& v) { + // If nothing, give it the benefit of the doubt; + // can't take address of nothing. + if (v.size() <= 0) + return true; return (const char*)&v <= (const char*)(&v[0]) && (const char*)(&v[0]) < (const char*)&v+sizeof(v); } -- cgit v1.2.1