forked from qt-creator/qt-creator
C++: Use soft asserts instead of assert()
Some qmake versions ignore "DEFINES += NDEBUG" on Windows. Change-Id: Ibdf3b1036c2331dcef61dcd278463c02754044d2 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
7
src/libs/3rdparty/cplusplus/Scope.cpp
vendored
7
src/libs/3rdparty/cplusplus/Scope.cpp
vendored
@@ -23,7 +23,9 @@
|
||||
#include "Names.h"
|
||||
#include "Literals.h"
|
||||
#include "Templates.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "cppassert.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
@@ -107,6 +109,8 @@ SymbolTable::~SymbolTable()
|
||||
|
||||
void SymbolTable::enterSymbol(Symbol *symbol)
|
||||
{
|
||||
CPP_ASSERT(! symbol->_scope || symbol->enclosingScope() == _owner, return);
|
||||
|
||||
if (++_symbolCount == _allocatedSymbols) {
|
||||
_allocatedSymbols <<= 1;
|
||||
if (! _allocatedSymbols)
|
||||
@@ -115,7 +119,6 @@ void SymbolTable::enterSymbol(Symbol *symbol)
|
||||
_symbols = reinterpret_cast<Symbol **>(realloc(_symbols, sizeof(Symbol *) * _allocatedSymbols));
|
||||
}
|
||||
|
||||
assert(! symbol->_scope || symbol->enclosingScope() == _owner);
|
||||
symbol->_index = _symbolCount;
|
||||
symbol->_scope = _owner;
|
||||
_symbols[_symbolCount] = symbol;
|
||||
|
||||
Reference in New Issue
Block a user