You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2022/02/04 18:39:44 UTC

[GitHub] [incubator-teaclave] bigdata-memory commented on a change in pull request #608: update WAMR

bigdata-memory commented on a change in pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608#discussion_r799717288



##########
File path: executor/src/wamr.rs
##########
@@ -191,17 +213,33 @@ impl TeaclaveExecutor for WAMicroRuntime {
                 std::ptr::null(),
             )
         };
-        assert!((entry_func as usize) != 0);
+        early_terminate!(
+            (entry_func as usize) != 0,
+            "wasm_runtime_lookup_function failed",
+            {
+                wasm_runtime_deinstantiate(module_instance);
+                wasm_runtime_unload(module);
+                wasm_runtime_destroy();
+            }
+        );
 
         let exec_env = unsafe { wasm_runtime_create_exec_env(module_instance, DEFAULT_STACK_SIZE) };
-        assert!((exec_env as usize) != 0);
+        early_terminate!(
+            (exec_env as usize) != 0,
+            "wasm_runtime_create_exec_env failed",
+            {
+                wasm_runtime_deinstantiate(module_instance);
+                wasm_runtime_unload(module);

Review comment:
       Looks like this block of code can be further abstracted away w.r.t. DRY.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org