summaryrefslogtreecommitdiff
path: root/src/w32menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32menu.c')
-rw-r--r--src/w32menu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/w32menu.c b/src/w32menu.c
index ca0ed0b6320..8021dece951 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1355,12 +1355,13 @@ set_frame_menubar (f, first_time, deep_p)
inhibit_garbage_collection ();
/* Save the frame's previous menu bar contents data. */
- bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
- previous_menu_items_used * sizeof (Lisp_Object));
+ if (previous_menu_items_used)
+ bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
+ previous_menu_items_used * sizeof (Lisp_Object));
/* Fill in the current menu bar contents. */
menu_items = f->menu_bar_vector;
- menu_items_allocated = XVECTOR (menu_items)->size;
+ menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
init_menu_items ();
for (i = 0; i < XVECTOR (items)->size; i += 4)
{