diff --git a/kotlin-native/runtime/src/mm/cpp/ShadowStack.cpp b/kotlin-native/runtime/src/mm/cpp/ShadowStack.cpp index ba543b06d44..3ed757a9cc8 100644 --- a/kotlin-native/runtime/src/mm/cpp/ShadowStack.cpp +++ b/kotlin-native/runtime/src/mm/cpp/ShadowStack.cpp @@ -33,6 +33,7 @@ void mm::ShadowStack::EnterFrame(ObjHeader** start, int parameters, int count) n void mm::ShadowStack::LeaveFrame(ObjHeader** start, int parameters, int count) noexcept { FrameOverlay* frame = reinterpret_cast(start); + RuntimeAssert(currentFrame_ == frame, "Frame to leave is expected to be %p, but current frame is %p", frame, currentFrame_); currentFrame_ = frame->previous; }