From 6c75e145ec58d63a1f9f426a934d7298c4f96783 Mon Sep 17 00:00:00 2001 From: Michael Starzinger Date: Fri, 12 May 2017 13:58:45 +0200 Subject: [PATCH] [asm.js] Remove dead nullptr check of signatures. R=clemensh@chromium.org Change-Id: I616a972283cc85ccaf63c46d0cc11ccbb7563a46 Reviewed-on: https://chromium-review.googlesource.com/504527 Reviewed-by: Clemens Hammacher Commit-Queue: Michael Starzinger Cr-Commit-Position: refs/heads/master@{#45289} --- src/asmjs/asm-parser.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/asmjs/asm-parser.cc b/src/asmjs/asm-parser.cc index 3bc86d31c8..753b8ab722 100644 --- a/src/asmjs/asm-parser.cc +++ b/src/asmjs/asm-parser.cc @@ -156,7 +156,7 @@ FunctionSig* AsmJsParser::ConvertSignature( } else if (param->IsA(AsmType::Int())) { sig_builder.AddParam(kWasmI32); } else { - return nullptr; + UNREACHABLE(); } } if (!return_type->IsA(AsmType::Void())) { @@ -167,7 +167,7 @@ FunctionSig* AsmJsParser::ConvertSignature( } else if (return_type->IsA(AsmType::Signed())) { sig_builder.AddReturn(kWasmI32); } else { - return 0; + UNREACHABLE(); } } return sig_builder.Build(); @@ -767,9 +767,6 @@ void AsmJsParser::ValidateFunction() { // TODO(bradnelson): WasmModuleBuilder can't take this in the right order. // We should fix that so we can use it instead. FunctionSig* sig = ConvertSignature(return_type_, params); - if (sig == nullptr) { - FAIL("Invalid function signature in declaration"); - } current_function_builder_->SetSignature(sig); for (auto local : locals) { current_function_builder_->AddLocal(local); @@ -2140,9 +2137,6 @@ AsmType* AsmJsParser::ValidateCall() { function_type->AsFunctionType()->AddArgument(t); } FunctionSig* sig = ConvertSignature(return_type, param_types); - if (sig == nullptr) { - FAILn("Invalid function signature"); - } uint32_t signature_index = module_builder_->AddSignature(sig); // Emit actual function invocation depending on the kind. At this point we