diff options
author | Stephen D. Huston <shuston@apache.org> | 2009-06-26 22:31:49 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2009-06-26 22:31:49 +0000 |
commit | f05b8b79baae55172b0cd3cfe894506a8227eca0 (patch) | |
tree | 13d457a53439e224b0440b6206b4fae4c2f29702 /qpid/cpp/src/tests/InlineVector.cpp | |
parent | 8ee91d113f20dd874beca66c40394d721ff66f7b (diff) | |
download | qpid-python-f05b8b79baae55172b0cd3cfe894506a8227eca0.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@788893 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/InlineVector.cpp')
-rw-r--r-- | qpid/cpp/src/tests/InlineVector.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/InlineVector.cpp b/qpid/cpp/src/tests/InlineVector.cpp index bcd36e47b4..009f10af9d 100644 --- a/qpid/cpp/src/tests/InlineVector.cpp +++ b/qpid/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); } |