[svn:parrot] r46449 - in trunk: compilers/imcc t/compilers/imcc/syn

plobsing at svn.parrot.org plobsing at svn.parrot.org
Mon May 10 01:12:37 UTC 2010


Author: plobsing
Date: Mon May 10 01:12:36 2010
New Revision: 46449
URL: https://trac.parrot.org/parrot/changeset/46449

Log:
croak on multiple declarations of the same lexical

Modified:
   trunk/compilers/imcc/pbc.c
   trunk/t/compilers/imcc/syn/clash.t

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Mon May 10 00:48:15 2010	(r46448)
+++ trunk/compilers/imcc/pbc.c	Mon May 10 01:12:36 2010	(r46449)
@@ -1156,6 +1156,10 @@
                             "add lexical '%s' to sub name '%Ss'\n",
                             n->name, sub->name);
 
+                    if (VTABLE_exists_keyed_str(interp, lex_info, lex_name))
+                        IMCC_fataly(interp, EXCEPTION_INVALID_OPERATION,
+                            "Multiple declarations of lexical '%S'\n", lex_name);
+
                     VTABLE_set_integer_keyed_str(interp, lex_info,
                             lex_name, r->color);
 

Modified: trunk/t/compilers/imcc/syn/clash.t
==============================================================================
--- trunk/t/compilers/imcc/syn/clash.t	Mon May 10 00:48:15 2010	(r46448)
+++ trunk/t/compilers/imcc/syn/clash.t	Mon May 10 01:12:36 2010	(r46449)
@@ -261,7 +261,7 @@
 ok
 OUT
 
-pir_error_output_like( <<'CODE', <<'OUT', 'lexical redeclared in sub', todo => 'TT #1073' );
+pir_error_output_like( <<'CODE', <<'OUT', 'lexical redeclared in sub');
 .sub 'main' :main
     .lex 'foo', $P0
     $P1 = box 'ok 1'
@@ -282,7 +282,7 @@
     store_lex 'foo', $P7
 .end
 CODE
-/Lexical 'foo' already declared/
+/Multiple declarations of lexical 'foo'/
 OUT
 
 # Local Variables:


More information about the parrot-commits mailing list