diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index 85f58604..1f8607dc 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -280,6 +280,14 @@ namespace cling { HeaderSearchOptions& headerOpts = CI->getHeaderSearchOpts(); const bool IsFramework = false; const bool IsSysRootRelative = true; + + // Avoid duplicates; just return early if incpath is already in UserEntries. + for (std::vector::const_iterator + I = headerOpts.UserEntries.begin(), + E = headerOpts.UserEntries.end(); I != E; ++I) + if (I->Path == incpath) + return; + headerOpts.AddPath(incpath, frontend::Angled, IsFramework, IsSysRootRelative);