xous-core/services/shellchat
Sean Cross 5dfad296ae xous: mark MemoryRange::as_slice and friends as unsafe
Mark `MemoryRange::as_slice()` and `MemoryRange::as_slice_mut()` as
unsafe.

This is due to the fact that not all representable types can be cast to
an arbitrary value. For example, if Process A sends random values to
Process B, then Process B casts the memory to a slice of `bool`, then
any values that are not 0 or 1 are undefined.

Because these functions can leak UB into the program, they are marked as
unsafe.

This patch adds `unsafe {}` blocks to all instances where this function
is called. Additionally, all instances have been checked to verify that
they do not cast to any invalid types -- most use `u8` or `u32`.

Additionally, the long-deprecated `MemoryRange::from_parts()` call was
removed, since that causes UB without being marked as unsafe.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-09-12 10:07:38 +08:00
..
locales add automounter to shellchat, and initial wait message 2022-11-06 03:11:23 +08:00
src xous: mark MemoryRange::as_slice and friends as unsafe 2023-09-12 10:07:38 +08:00
Cargo.toml publish package updates, sync to release tag 2023-08-08 14:35:49 +08:00
README.md
shellchat_screen1.png

Shell Chat

shellchat is the basic command line environment for Precursor. It houses most of the system maintenanence and test commands.

If you'd like to make your own REPL-type app, check out apps/repl/ for a pared-down version of shellchat which is a better starting point.