Do not try to execute empty programs.

After failing to read a non-existing file, the shell tried to execute the resulting empty program, which resulted in a null pointer dereference. This patch avoids execution of empty programs.

Review URL: http://codereview.chromium.org/6777005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ae65366f
// Copyright 2009 the V8 project authors. All rights reserved.
// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
......@@ -112,6 +112,7 @@ class SourceGroup {
v8::Handle<v8::String> source = ReadFile(arg);
if (source.IsEmpty()) {
printf("Error reading '%s'\n", arg);
continue;
}
if (!ExecuteString(source, file_name, false, true)) {
ExitShell(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment