CHERIoT-Platform / network-stack

5 stars 1 forks source link

Convert heap_allocate null pointer checks to valid tag checks. #25

Closed hlef closed 3 months ago

hlef commented 4 months ago

Pointers returned by heap_allocate should be checked for validity through the tag bit, not by comparing them with nullptr. Here we use the C low-level builtin instead of the C++ Capability API to limit the amount of refactoring needed.

Go through all allocation sites of the repository and update where needed.

This does the same as b35d1d944fd9038b0c821e9e51d2b6822dcc8cf8 in the main tree.