+#define AO_CHECK_STACK 0
+
+#if AO_CHECK_STACK
+static uint8_t in_yield;
+
+static inline void ao_check_stack(void) {
+ uint8_t q;
+ if (!in_yield && ao_cur_task && &q < &ao_cur_task->stack[0])
+ ao_panic(AO_PANIC_STACK);
+}
+#else
+#define ao_check_stack()
+#endif
+