summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-06-26 22:31:49 +0000
committerStephen D. Huston <shuston@apache.org>2009-06-26 22:31:49 +0000
commit403d11fcfc8686ce4670f2c42813f869678b0e52 (patch)
treed6f62ae7e38d4010ba5bfce1bc914b59af6ff4ca
parent626735d21015a192fd3ff93197c2338c9125e5ac (diff)
downloadqpid-python-403d11fcfc8686ce4670f2c42813f869678b0e52.tar.gz
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
-rw-r--r--cpp/src/tests/InlineVector.cpp4
1 files changed, 4 insertions, 0 deletions
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<int, 3> 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);
}