Add comment about derefing typecasted pointer

This commit is contained in:
Mark McCaskey
2020-06-16 13:01:51 -07:00
parent d85a5c56f1
commit cf3a391422

View File

@@ -379,6 +379,8 @@ where
Env: Sized + 'static,
{
fn call(&self, args: &[Val]) -> Result<Vec<Val>, RuntimeError> {
// TODO: the `&mut *self.env.as_ptr()` is likely invoking some "mild"
// undefined behavior due to how it's used in the static fn call
unsafe { (*self.func)(&mut *self.env.as_ptr(), &args) }
}
fn function_type(&self) -> &FunctionType {