preprocessor: Don't access empty lists

libc aborts with:

/usr/include/c++/4.4/debug/list:256:error: attempt to access an element in
    an empty container.

Objects involved in the operation:
sequence "this" @ 0x0xbfffe5f0 {
  type = NSt7__debug4listISsSaISsEEE;
}

otherwise.
This commit is contained in:
Simon Kagstrom 2012-12-28 10:31:56 +01:00
parent de2c133f6a
commit 1e4288fe2e
1 changed files with 1 additions and 1 deletions

View File

@ -2131,7 +2131,7 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath
// filename contains now a file name e.g. "menu.h"
std::string processedFile;
std::string filepath;
if (headerType == UserHeader)
if (headerType == UserHeader && !paths.empty())
filepath = paths.back();
std::ifstream fin;
const bool fileOpened(openHeader(filename, includePaths, filepath, fin));