1
0
Fork 0

scan-build

This commit is contained in:
Jan Steemann 2015-09-30 17:28:52 +02:00
parent 1ee1a87ae0
commit 0ea2247eb0
8 changed files with 15 additions and 7 deletions

View File

@ -732,6 +732,10 @@ struct CoordinatorInstanciator : public WalkerWorker<ExecutionNode> {
else {
THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL);
}
if (remoteNode == nullptr) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL);
}
auto&& shardIds = collection->shardIds();

View File

@ -907,7 +907,7 @@ void GeoResultsInsertPoint(GeoResults * gr, int slot, double snmd)
if(gr->snmd[jj1]>gr->snmd[jj2])
{
temp=jj1;
jj1=jj2;
// jj1=jj2;
jj2=temp;
}
/* so now jj2 is >= jj1 */

View File

@ -568,7 +568,7 @@ void ApplicationV8::collectGarbage () {
// can be performed more early for all dirty contexts. The flag is set
// to false again once all contexts have been cleaned up and there is nothing
// more to do
bool useReducedWait = false;
volatile bool useReducedWait = false;
// the time we'll wait for a signal
uint64_t const regularWaitTime = (uint64_t) (_gcFrequency * 1000.0 * 1000.0);

View File

@ -48,7 +48,7 @@ struct VertexId {
VertexId ()
: cid(0),
key(nullptr) {
key("") {
}
VertexId (TRI_voc_cid_t cid, char const* key)

View File

@ -158,7 +158,6 @@ SlotInfo Slots::nextUnused (uint32_t size) {
CONDITION_LOCKER(guard, _condition);
TRI_ASSERT(_waiting > 0);
--_waiting;
hasWaited = false;
}
// cycle until we have a valid logfile
@ -286,7 +285,6 @@ SlotInfo Slots::nextUnused (uint32_t size,
CONDITION_LOCKER(guard, _condition);
TRI_ASSERT(_waiting > 0);
--_waiting;
hasWaited = false;
}
// cycle until we have a valid logfile

View File

@ -1125,6 +1125,7 @@ namespace triagens {
IndexType oldAlloc = b._nrAlloc;
b._nrAlloc = static_cast<IndexType>(TRI_NearPrime(static_cast<uint64_t>(size)));
try {
b._table = new EntryType[b._nrAlloc];
#ifdef __linux__

View File

@ -236,6 +236,8 @@ namespace triagens {
// This might throw, is catched outside
b._table = new Element* [targetSize];
b._nrAlloc = targetSize;
#ifdef __linux__
if (b._nrAlloc > 1000000) {
@ -251,10 +253,9 @@ namespace triagens {
b._table[i] = nullptr;
}
b._nrAlloc = targetSize;
if (b._nrUsed > 0) {
uint64_t const n = b._nrAlloc;
TRI_ASSERT(n > 0);
for (uint64_t j = 0; j < oldAlloc; j++) {
Element* element = oldTable[j];

View File

@ -1166,6 +1166,10 @@ static void JS_Copy (const v8::FunctionCallbackInfo<v8::Value>& args) {
TRI_V8_THROW_RANGE_ERROR("sourceEnd out of bounds");
}
if (target_data == nullptr || source == nullptr || source->_data == nullptr) {
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid pointer value");
}
size_t to_copy = MIN(MIN(source_end - source_start,
target_length - target_start),
source->_length - source_start);