Ignore:
Timestamp:
Apr 22, 2013, 11:21:10 AM (12 years ago)
Author:
[email protected]
Message:

2013-04-22 Oliver Hunt <[email protected]>

Perform null check before trying to use the result of readline()

RS=Gavin

  • jsc.cpp: (runInteractive):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r148849 r148897  
    622622            error = ParserError();
    623623            char* line = readline(source.isEmpty() ? interactivePrompt : "... ");
     624            shouldQuit = !line;
     625            if (!line)
     626                break;
    624627            source = source + line;
    625628            source = source + '\n';
    626629            checkSyntax(globalObject->globalExec(), makeSource(source, interpreterName), error);
    627             shouldQuit = !line;
    628             if (!line || !line[0])
     630            if (!line[0])
    629631                break;
    630             if (line[0])
    631                 add_history(line);
     632            add_history(line);
    632633        } while (error.m_syntaxErrorType == ParserError::SyntaxErrorRecoverable);
    633634       
Note: See TracChangeset for help on using the changeset viewer.