int Pos = PPEI.Position;
if (Pos < 0) {
- assert(unsigned(-Pos-1) < LoadedPreprocessedEntities.size() &&
- "Out-of bounds loaded preprocessed entity");
+ if (unsigned(-Pos-1) >= LoadedPreprocessedEntities.size()) {
+ assert(0 && "Out-of bounds loaded preprocessed entity");
+ return false;
+ }
assert(ExternalSource && "No external source to load from");
unsigned LoadedIndex = LoadedPreprocessedEntities.size()+Pos;
if (PreprocessedEntity *PPE = LoadedPreprocessedEntities[LoadedIndex])
FID, SourceMgr);
}
- assert(unsigned(Pos) < PreprocessedEntities.size() &&
- "Out-of bounds local preprocessed entity");
+ if (unsigned(Pos) >= PreprocessedEntities.size()) {
+ assert(0 && "Out-of bounds local preprocessed entity");
+ return false;
+ }
return isPreprocessedEntityIfInFileID(PreprocessedEntities[Pos],
FID, SourceMgr);
}