mirror of https://github.com/AxioDL/tinyxml2.git
Unlinked nodes assertions
This commit is contained in:
parent
e84f68a68a
commit
c2f677b05e
|
@ -1994,6 +1994,7 @@ XMLDocument::~XMLDocument()
|
||||||
|
|
||||||
void XMLDocument::MarkInUse(XMLNode* node)
|
void XMLDocument::MarkInUse(XMLNode* node)
|
||||||
{
|
{
|
||||||
|
TIXMLASSERT(node);
|
||||||
TIXMLASSERT(node->_parent == 0);
|
TIXMLASSERT(node->_parent == 0);
|
||||||
|
|
||||||
for (int i = 0; i < _unlinked.Size(); ++i) {
|
for (int i = 0; i < _unlinked.Size(); ++i) {
|
||||||
|
|
|
@ -265,8 +265,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwapRemove(int i) {
|
void SwapRemove(int i) {
|
||||||
TIXMLASSERT(i >= 0);
|
TIXMLASSERT(i >= 0 && i < _size);
|
||||||
TIXMLASSERT(i < _size);
|
TIXMLASSERT(_size > 0);
|
||||||
_mem[i] = _mem[_size - 1];
|
_mem[i] = _mem[_size - 1];
|
||||||
--_size;
|
--_size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue