File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,17 +19,24 @@ int main(int argc, char *argv[]) {
1919 abort ();
2020 }
2121
22+ /* Allocate a chunk, and assign a tagged pointer to p */
2223 void * p = iso_alloc_from_zone_tagged (_zone_handle );
24+
25+ /* Remove the tag from the pointer */
2326 void * up = iso_alloc_untag_ptr (p , _zone_handle );
27+
28+ /* Free the underlying chunk with the untagged pointer */
2429 iso_free_from_zone (up , _zone_handle );
30+
31+ /* Flush all caches includes the delayed free list. When
32+ * the chunk is free'd its tag will be changed */
2533 iso_flush_caches ();
26- /* The free() path will have changed the tag for this pointer */
34+
35+ /* Verify the tag on our stale tagged pointer. This should
36+ * abort because the tag was changed during free() */
2737 iso_alloc_verify_ptr_tag (p , _zone_handle );
28- iso_alloc_destroy_zone (_zone_handle );
2938
30- #if !MEMORY_TAGGING
31- return -1 ;
32- #endif
39+ iso_alloc_destroy_zone (_zone_handle );
3340
3441 return 0 ;
3542}
You can’t perform that action at this time.
0 commit comments