This is an automated email from the ASF dual-hosted git repository.

rduan pushed a commit to branch emm-dev
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git


The following commit(s) were added to refs/heads/emm-dev by this push:
     new 04825c16 Fix try_error macro in sgx_trts
04825c16 is described below

commit 04825c169a80eea8b4ae000cb10e543fd44860f8
Author: volcano <[email protected]>
AuthorDate: Thu Sep 14 11:10:15 2023 +0800

    Fix try_error macro in sgx_trts
---
 sgx_trts/src/veh/exception.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sgx_trts/src/veh/exception.rs b/sgx_trts/src/veh/exception.rs
index a05a2afa..e55c0cd8 100644
--- a/sgx_trts/src/veh/exception.rs
+++ b/sgx_trts/src/veh/exception.rs
@@ -32,13 +32,14 @@ use sgx_types::error::{SgxResult, SgxStatus};
 
 macro_rules! try_error {
     ($cond:expr) => {
-        if $cond {
+        if ($cond) {
             state::set_state(State::Crashed);
             bail!(SgxStatus::EnclaveCrashed);
         }
     };
     ($cond:expr, $e:expr) => {
-        if !($cond) {
+        if ($cond) {
+            state::set_state(State::Crashed);
             bail!($e);
         }
     };


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to