From: Arnaud Giersch Date: Mon, 4 Feb 2013 14:05:27 +0000 (+0100) Subject: Avoid to return from inside a TRY block. X-Git-Tag: v3_9_90~510^2~53 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6d14c1a0c31bf23b35ec3df2ebc361fc965591b3 Avoid to return from inside a TRY block. --- diff --git a/src/bindings/java/jmsg_comm.c b/src/bindings/java/jmsg_comm.c index 9fae1424a3..669e91f407 100644 --- a/src/bindings/java/jmsg_comm.c +++ b/src/bindings/java/jmsg_comm.c @@ -82,28 +82,17 @@ Java_org_simgrid_msg_Comm_test(JNIEnv *env, jobject jcomm) { jxbt_throw_native(env,bprintf("comm is null")); return JNI_FALSE; } - xbt_ex_t e; - TRY { - if (MSG_comm_test(comm)) { - msg_error_t status = MSG_comm_get_status(comm); - if (status == MSG_OK) { - jcomm_bind_task(env,jcomm); - return JNI_TRUE; - } - else { - //send the correct exception - jmsg_throw_status(env,status); - return JNI_FALSE; - } - } - else { - return JNI_FALSE; + + if (MSG_comm_test(comm)) { + msg_error_t status = MSG_comm_get_status(comm); + if (status == MSG_OK) { + jcomm_bind_task(env,jcomm); + return JNI_TRUE; + } else { + //send the correct exception + jmsg_throw_status(env,status); } } - CATCH(e) { - xbt_ex_free(e); - } - return JNI_FALSE; } JNIEXPORT void JNICALL diff --git a/src/instr/instr_paje_values.c b/src/instr/instr_paje_values.c index b6f1e60d14..6773dd9648 100644 --- a/src/instr/instr_paje_values.c +++ b/src/instr/instr_paje_values.c @@ -32,15 +32,16 @@ val_t PJ_value_new (const char *name, const char *color, type_t father) val_t PJ_value_get_or_new (const char *name, const char *color, type_t father) { + val_t ret = 0; xbt_ex_t e; TRY { - return PJ_value_get(name, father); + ret = PJ_value_get(name, father); } CATCH(e) { xbt_ex_free(e); - return PJ_value_new(name, color, father); + ret = PJ_value_new(name, color, father); } - THROW_IMPOSSIBLE; + return ret; } val_t PJ_value_get (const char *name, type_t father)