Open AlixANNERAUD opened 2 days ago
there's a lifetime issue with Instance, Module and Runtime, since Instance can outlive Module, and Module can outlive Runtime which leads to UB/segfault
I don't fully understand those points. Could you please provide us with more details or an example?
Lifetime in rust needs to be defined explicitly in rust when dealing with pointers / references. The compiler always ensure that an explicit lifetime is defined for references in a struct but not for raw pointers.
I think there's a lifetime issue with
Instance
,Module
andRuntime
, sinceInstance
can outliveModule
, andModule
can outliveRuntime
which leads to UB/segfault. A lifetime should be added to each object type and propagated to children "objects" (using using PhatomData marker since we are dealing with pointers). If you are ok with that, I can do the PR RN.