2
0
Эх сурвалжийг харах

Fixed scope check for variables from inline procedures

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7558 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 жил өмнө
parent
commit
ea68b4add9

+ 1 - 1
source/FoxIntermediateBackend.Mod

@@ -3904,7 +3904,7 @@ TYPE
 			IF Trace THEN TraceEnter("VisitSymbolDesignator") END;
 			IF x.left # NIL THEN Expression(x.left) END;
 			Symbol(x.symbol,result);
-			IF backend.cooperative & (x.symbol IS SyntaxTree.Variable) & (x.symbol.scope IS SyntaxTree.RecordScope) THEN
+			IF backend.cooperative & (x.symbol IS SyntaxTree.Variable) & (x.symbol.scope # NIL) & (x.symbol.scope IS SyntaxTree.RecordScope) THEN
 				ASSERT ((x.left # NIL) & (x.left.type.resolved IS SyntaxTree.RecordType));
 				ownerType := x.symbol.scope(SyntaxTree.RecordScope).ownerRecord;
 				designatorType := x.left.type.resolved(SyntaxTree.RecordType);