From ef2371f6820e5af099adef4895869dd3440bc181 Mon Sep 17 00:00:00 2001 From: Andrew Scheidecker Date: Fri, 23 Jun 2017 11:05:41 -0400 Subject: [PATCH] Fix invokes after an invalid module in a test script reporting redundant errors --- libraries/wasm-jit/Source/Programs/Test.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/wasm-jit/Source/Programs/Test.cpp b/libraries/wasm-jit/Source/Programs/Test.cpp index 6796bcd3d..d6c4f49ac 100644 --- a/libraries/wasm-jit/Source/Programs/Test.cpp +++ b/libraries/wasm-jit/Source/Programs/Test.cpp @@ -148,15 +148,15 @@ bool processAction(TestScriptState& state,Action* action,Result& outResult) ModuleInstance* moduleInstance = getModuleContextByInternalName(state,invokeAction->locus,"invoke",invokeAction->internalModuleName); // A null module instance at this point indicates a module that failed to link or instantiate, so don't produce further errors. - if(moduleInstance) - { - // Find the named export in the module instance. - auto functionInstance = asFunctionNullable(getInstanceExport(moduleInstance,invokeAction->exportName)); - if(!functionInstance) { testErrorf(state,invokeAction->locus,"couldn't find exported function with name: %s",invokeAction->exportName.c_str()); return false; } + if(!moduleInstance) { return false; } + + // Find the named export in the module instance. + auto functionInstance = asFunctionNullable(getInstanceExport(moduleInstance,invokeAction->exportName)); + if(!functionInstance) { testErrorf(state,invokeAction->locus,"couldn't find exported function with name: %s",invokeAction->exportName.c_str()); return false; } + + // Execute the invoke + outResult = invokeFunction(functionInstance,invokeAction->arguments); - // Execute the invoke - outResult = invokeFunction(functionInstance,invokeAction->arguments); - } return true; } case ActionType::get: -- GitLab