Skip to content

Commit

Permalink
Add some checks
Browse files Browse the repository at this point in the history
  • Loading branch information
0152la committed Apr 10, 2024
1 parent d27b093 commit 66126d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hybrid/threads_ddc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* The number of threads to execute can be changed by modifying `t_count`.
***/

#include <assert.h>
#include <math.h>
#include <pthread.h>
#include <stdbool.h>
Expand All @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 66126d7

Please sign in to comment.