Skip to content

Commit

Permalink
Updated cell_box_uaf.cxx for testing with uaf fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbaxter committed Sep 12, 2024
1 parent 888fc22 commit f967ec5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libsafecxx/test/broken/cell_box_uaf.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#feature on safety

namespace std2 {

// unsafe_cell must be in std2 for the declaration to be seen by the
// compiler.
// We could improve by making an [[unsafe_cell]] attribute.
template<class T+>
class [[unsafe::sync(false)]] unsafe_cell
{
Expand All @@ -18,11 +23,12 @@ class [[unsafe::sync(false)]] unsafe_cell
return const_cast<T*>(addr self->t_);
}
};
}

template<class T+>
class [[unsafe::sync(false)]] cell
{
unsafe_cell<T> t_;
std2::unsafe_cell<T> t_;

public:

Expand Down

0 comments on commit f967ec5

Please sign in to comment.