From: Sean Callanan Date: Mon, 3 Dec 2012 21:28:37 +0000 (+0000) Subject: Fixed a crash in which we examined the extension of X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=811209be115d9d039d47aec0135f0629831cd53e;p=platform%2Fupstream%2Fllvm.git Fixed a crash in which we examined the extension of a file name, whether the file name had an extension or not. llvm-svn: 169156 --- diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index b23cda3..ac0baf4 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -2493,10 +2493,13 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname, // strip .py or .pyc extension ConstString extension = target_file.GetFileNameExtension(); - if (::strcmp(extension.GetCString(), "py") == 0) - basename.resize(basename.length()-3); - else if(::strcmp(extension.GetCString(), "pyc") == 0) - basename.resize(basename.length()-4); + if (extension) + { + if (::strcmp(extension.GetCString(), "py") == 0) + basename.resize(basename.length()-3); + else if(::strcmp(extension.GetCString(), "pyc") == 0) + basename.resize(basename.length()-4); + } // check if the module is already import-ed command_stream.Clear();