{
int i;
widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
- widget_value **submenu_stack
- = alloca (menu_items_used * sizeof *submenu_stack);
- Lisp_Object *subprefix_stack
- = alloca (menu_items_used * sizeof *subprefix_stack);
+ widget_value **submenu_stack;
+ Lisp_Object *subprefix_stack;
int submenu_depth = 0;
+ specpdl_ref specpdl_count;
- specpdl_ref specpdl_count = SPECPDL_INDEX ();
+ USE_SAFE_ALLOCA;
+
+ submenu_stack = SAFE_ALLOCA (menu_items_used
+ * sizeof *submenu_stack);
+ subprefix_stack = SAFE_ALLOCA (menu_items_used
+ * sizeof *subprefix_stack);
+
+ specpdl_count = SPECPDL_INDEX ();
eassert (FRAME_X_P (f));
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
*error_name = "Empty menu";
+ SAFE_FREE ();
return Qnil;
}
entry = Fcons (subprefix_stack[j], entry);
}
unblock_input ();
+
+ SAFE_FREE ();
return entry;
}
i += MENU_ITEMS_ITEM_LENGTH;
}
unblock_input ();
+
+ SAFE_FREE ();
return Qnil;
}
\f