RustPlayground icon indicating copy to clipboard operation
RustPlayground copied to clipboard

Throwing panics over the FFI is UB

Open maddiemort opened this issue 6 years ago • 1 comments

I notice that in a few places within the playground-utils-ffi crate, calls to expect() are made, and within xi-ffi, several calls to assert!() are made.

As far as I understand, throwing panics over the FFI is UB, and I wanted to flag this to your attention; I would suggest these be replaced with some other method of indicating errors. I know that Mozilla's ffi-support crate provides utilities for helping with this, for example.

maddiemort avatar May 01 '19 00:05 maddiemort

Good issue, thanks. This is something I was happy to gloss over while this was prototype code, but should probably address if I'm shipping it.

cmyr avatar May 01 '19 16:05 cmyr