[svn:parrot] r39795 - branches/pmc_pct/compilers/pmcc/src

cotto at svn.parrot.org cotto at svn.parrot.org
Fri Jun 26 05:03:12 UTC 2009


Author: cotto
Date: Fri Jun 26 05:03:09 2009
New Revision: 39795
URL: https://trac.parrot.org/parrot/changeset/39795

Log:
[pmcc] fail noisily when attempting to multiply inherit from two parents with ATTRs

Modified:
   branches/pmc_pct/compilers/pmcc/src/nodes.pir

Modified: branches/pmc_pct/compilers/pmcc/src/nodes.pir
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/nodes.pir	Fri Jun 26 03:44:09 2009	(r39794)
+++ branches/pmc_pct/compilers/pmcc/src/nodes.pir	Fri Jun 26 05:03:09 2009	(r39795)
@@ -192,10 +192,14 @@
 
     .local pmc pmc_path, attrs, fh, it, filename
     .local string dumpname
+    .local int already_have_attrs
 
     #search through all dirs in @pmc_path, looking for a file
     #named lc(pmcname) ~".dump"
 
+    $P0 = self.'attrs'()
+    already_have_attrs = elements $P0
+
     pmc_path = get_hll_global ['PMC';'Emitter'], '@?pmc_path'
     dumpname = pmcname
     dumpname = downcase dumpname
@@ -239,6 +243,7 @@
 
   iter_loop:
     unless it goto iter_done
+    if already_have_attrs goto cant_add_attrs
     attr = shift it
     name  = attr['name']
     type  = attr['type']
@@ -254,6 +259,9 @@
     printerr pmcname
     printerr ".pmc\n"
     .return ()
+
+  cant_add_attrs:
+    die "attempt to multiply inherit from two parents which both have ATTRs"
 .end
 
 


More information about the parrot-commits mailing list