+#ifdef _MSC_VER
+
+#define MONO_INIT_CONTEXT_FROM_FUNC(ctx, start_func) do { \
+ guint64 stackptr; \
+ mono_arch_flush_register_windows (); \
+ stackptr = ((guint64)_GetAddressOfReturnAddress () - sizeof (void*));\
+ MONO_CONTEXT_SET_IP ((ctx), (start_func)); \
+ MONO_CONTEXT_SET_BP ((ctx), stackptr); \
+ MONO_CONTEXT_SET_SP ((ctx), stackptr); \
+} while (0)
+
+#else
+
+/*
+ * __builtin_frame_address () is broken on some older gcc versions in the presence of
+ * frame pointer elimination, see bug #82095.
+ */