[K/N] Fix currentFrame in smaller scope, to avoid gc while having incorrect shadow stack
This commit is contained in:
@@ -498,6 +498,14 @@ private:
|
||||
bool reentrant_;
|
||||
};
|
||||
|
||||
class CurrentFrameGuard : Pinned {
|
||||
public:
|
||||
CurrentFrameGuard() : frame_(getCurrentFrame()) {}
|
||||
~CurrentFrameGuard() { SetCurrentFrame(reinterpret_cast<ObjHeader**>(frame_)); }
|
||||
private:
|
||||
FrameOverlay* frame_;
|
||||
};
|
||||
|
||||
template <ThreadState state, typename R, typename... Args>
|
||||
ALWAYS_INLINE inline R CallWithThreadState(R(*function)(Args...), Args... args) {
|
||||
ThreadStateGuard guard(state);
|
||||
|
||||
Reference in New Issue
Block a user