Fix crash when no input filename was provided.

This commit is contained in:
Matt Pharr
2011-07-04 12:52:03 +01:00
parent c14c3ceba6
commit b0658549c5

View File

@@ -154,7 +154,7 @@ Module::CompileFile() {
if (runPreprocessor) {
std::string buffer;
llvm::raw_string_ostream os(buffer);
execPreprocessor(filename, &os);
execPreprocessor((filename != NULL) ? filename : "-", &os);
YY_BUFFER_STATE strbuf = yy_scan_string(os.str().c_str());
yyparse();
yy_delete_buffer(strbuf);