From 66126d788c2d2ad8c04c8f499cd590f7b9a93359 Mon Sep 17 00:00:00 2001 From: Andrei Lascu Date: Wed, 10 Apr 2024 11:13:18 +0100 Subject: [PATCH] Add some checks --- hybrid/threads_ddc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hybrid/threads_ddc.c b/hybrid/threads_ddc.c index 5fc31b9..ecdff2b 100644 --- a/hybrid/threads_ddc.c +++ b/hybrid/threads_ddc.c @@ -5,6 +5,7 @@ * The number of threads to execute can be changed by modifying `t_count`. ***/ +#include #include #include #include @@ -28,6 +29,7 @@ struct t_info void *run_thread(void *curr_t_info_ptr) { struct t_info *curr_t_info = (struct t_info *) curr_t_info_ptr; + void *__capability old_ddc = read_ddc(); void *__capability new_ddc = cheri_address_set(cheri_ddc_get(), (intptr_t) curr_t_info->addr_in); write_ddc(new_ddc); @@ -36,6 +38,8 @@ void *run_thread(void *curr_t_info_ptr) { }; curr_t_info->ddc_out = read_ddc(); + assert(cheri_address_get(curr_t_info->ddc_out) == (unsigned long) curr_t_info->addr_in); + assert(curr_t_info->ddc_out != old_ddc); return NULL; }