* c-typeck.c (c_begin_vm_scope): Fix file_scope processing.
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Jun 2006 00:14:03 +0000 (00:14 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Jun 2006 00:14:03 +0000 (00:14 +0000)
testsuite:
* gcc.dg/vla-7.c: Add.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114530 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vla-7.c [new file with mode: 0644]

index b33155d..4cde87a 100644 (file)
@@ -1,3 +1,7 @@
+2006-06-09  Mike Stump  <mrs@apple.com>
+
+       * c-typeck.c (c_begin_vm_scope): Fix file_scope processing.
+
 2006-06-09  David Daney  <ddaney@avtrex.com>
 
        * doc/install.texi: Add binutils version recommendation for mips-*-*.
index 7898d99..c2f6223 100644 (file)
@@ -7550,6 +7550,11 @@ c_begin_vm_scope (unsigned int scope)
   struct c_label_list *glist;
 
   gcc_assert (scope > 0);
+
+  /* At file_scope, we don't have to do any processing.  */
+  if (label_context_stack_vm == NULL)
+    return;
+
   if (c_switch_stack && !c_switch_stack->blocked_vm)
     c_switch_stack->blocked_vm = scope;
   for (glist = label_context_stack_vm->labels_used;
index 04f2d73..58def48 100644 (file)
@@ -1,3 +1,7 @@
+2006-06-09  Mike Stump  <mrs@apple.com>
+
+       * gcc.dg/vla-7.c: Add.
+
 2006-06-10  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/24558
diff --git a/gcc/testsuite/gcc.dg/vla-7.c b/gcc/testsuite/gcc.dg/vla-7.c
new file mode 100644 (file)
index 0000000..e8c8cd4
--- /dev/null
@@ -0,0 +1,3 @@
+/* { dg-options "-std=c99" } */
+
+int (*foo)(int (*a)[*]);