You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/10/08 23:50:02 UTC

[02/14] git commit: [flex-falcon] [refs/heads/develop] - Try to fix vector handling of nested vectors. Forward reference chasing has to be recursive, not just a one-level search

Try to fix vector handling of nested vectors.  Forward reference chasing has to be recursive, not just a one-level search


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d4ef754a
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d4ef754a
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d4ef754a

Branch: refs/heads/develop
Commit: d4ef754a98d066085db0d37bf70a66af02c28b01
Parents: 6481dc9
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:35:28 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:56 2013 -0700

----------------------------------------------------------------------
 compiler/src/org/apache/flex/abc/ABCParser.java | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4ef754a/compiler/src/org/apache/flex/abc/ABCParser.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/abc/ABCParser.java b/compiler/src/org/apache/flex/abc/ABCParser.java
index 8aa64bb..fbacda6 100644
--- a/compiler/src/org/apache/flex/abc/ABCParser.java
+++ b/compiler/src/org/apache/flex/abc/ABCParser.java
@@ -235,7 +235,8 @@ public class ABCParser
             Name name;
             int name_pos = p.pos;
             names[i] = name = readName(p);
-            if (name.isTypeName() && (name.getTypeNameBase() == null || name.getTypeNameParameter() == null))
+            if (name.isTypeName() && 
+                    usesForwardReference(name))
             {
                 // If this typename refers to names later in the table, we need to reprocess them later
                 // after the entire table has been read in
@@ -353,6 +354,24 @@ public class ABCParser
         vabc.visitEnd();
     }
 
+    private boolean usesForwardReference(Name name)
+    {
+        Name nameBase = name.getTypeNameBase();
+        Name nameParam = name.getTypeNameParameter();
+        if (nameBase == null || nameParam == null)
+            return true;
+        
+        if (nameBase != null && nameBase.isTypeName() && 
+                usesForwardReference(nameBase))
+            return true;
+        
+        if (nameParam != null && nameParam.isTypeName() &&
+                usesForwardReference(nameParam))
+            return true;
+        
+        return false;
+    }
+    
     /**
      * Simple struct to keep track of Names, and where in the abc they come from
      */