You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/06/17 19:01:19 UTC
[royale-compiler] branch develop updated: MXMLScopeBuilder: don't
try to resolve the definition of the base class because that can cause the
compiler to hang (closes #187)
This is an automated email from the ASF dual-hosted git repository.
joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push:
new 6da4dc4 MXMLScopeBuilder: don't try to resolve the definition of the base class because that can cause the compiler to hang (closes #187)
6da4dc4 is described below
commit 6da4dc4c38ab80229765e8feb1c89f95804963f6
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Jun 17 12:00:37 2021 -0700
MXMLScopeBuilder: don't try to resolve the definition of the base class because that can cause the compiler to hang (closes #187)
The same check happens in MXMLFileNode too, so that was redundant, and we're not losing anything by removing it.
---
.../compiler/internal/parsing/mxml/MXMLScopeBuilder.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/mxml/MXMLScopeBuilder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
index b3c4003..edd5653 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
@@ -35,7 +35,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.royale.compiler.common.IFileSpecificationGetter;
import org.apache.royale.compiler.common.Multiname;
import org.apache.royale.compiler.config.CompilerDiagnosticsConstants;
-import org.apache.royale.compiler.definitions.IDefinition;
import org.apache.royale.compiler.definitions.INamespaceDefinition;
import org.apache.royale.compiler.definitions.metadata.IMetaTag;
import org.apache.royale.compiler.definitions.references.INamespaceReference;
@@ -69,7 +68,6 @@ import org.apache.royale.compiler.mxml.IMXMLTextData.TextType;
import org.apache.royale.compiler.mxml.IMXMLUnitData;
import org.apache.royale.compiler.problems.ICompilerProblem;
import org.apache.royale.compiler.problems.MXMLLibraryTagNotTheFirstChildProblem;
-import org.apache.royale.compiler.problems.MXMLUnresolvedTagProblem;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
@@ -211,11 +209,11 @@ public class MXMLScopeBuilder
if (baseClass instanceof IResolvedQualifiersReference)
{
- IDefinition baseDef = ((IResolvedQualifiersReference)baseClass).resolve(project);
- if (baseDef == null)
- problems.add(new MXMLUnresolvedTagProblem(rootTag));
- else
- currentClassScope.addImport(baseDef.getQualifiedName());
+ // don't try to resolve the definition here because it can lead to
+ // the compiler getting into a deadlock. previously, we checked
+ // whether the definition resolved, but that is also handled in
+ // MXMLFileNode, so it was redundant and we can skip it. -JT
+ currentClassScope.addImport(baseClass.getDisplayString());
}
currentClassDefinition.setContainedScope(currentClassScope);