Commit 036d811f authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[asmjs] Return early when AsmWasmBuilder::Run fails.

R=bradnelson@chromium.org

Change-Id: Ifc492b2c2d361ebde5b143b599175b13860781ca
Reviewed-on: https://chromium-review.googlesource.com/448576
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43563}
parent 8b130a84
......@@ -2001,6 +2001,9 @@ AsmWasmBuilder::Result AsmWasmBuilder::Run(Handle<FixedArray>* foreign_args) {
info_->parse_info()->ast_value_factory(),
info_->script(), info_->literal(), &typer_);
bool success = impl.Build();
if (!success) {
return {nullptr, nullptr, success};
}
*foreign_args = impl.GetForeignArgs();
ZoneBuffer* module_buffer = new (zone) ZoneBuffer(zone);
impl.builder_->WriteTo(*module_buffer);
......
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