[wasm] Avoid crashing if parsing fails in asm -> wasm.

R=ahaas@chromium.org
LOG=Y
BUG=chromium:575369

Review URL: https://codereview.chromium.org/1577813002

Cr-Commit-Position: refs/heads/master@{#33206}
This commit is contained in:
titzer 2016-01-11 05:59:08 -08:00 committed by Commit bot
parent 56579ce480
commit 1ab97e901b

View File

@ -132,7 +132,10 @@ v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(i::ParseInfo* info) {
info->set_allow_lazy_parsing(false);
info->set_toplevel(true);
CHECK(i::Compiler::ParseAndAnalyze(info));
if (!i::Compiler::ParseAndAnalyze(info)) {
return nullptr;
}
info->set_literal(
info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun());