Browse Source

Fixed using null looplabel in copy. Fixes #287.

woollybah 7 years ago
parent
commit
77c52188df
1 changed files with 5 additions and 1 deletions
  1. 5 1
      stmt.bmx

+ 5 - 1
stmt.bmx

@@ -517,7 +517,11 @@ Type TRepeatStmt Extends TLoopStmt
 	End Method
 
 	Method OnCopy:TStmt( scope:TScopeDecl )
-		Return New TRepeatStmt.Create( block.CopyBlock( scope ),expr.Copy(),TLoopLabelDecl(loopLabel.Copy()) )
+		If loopLabel Then
+			Return New TRepeatStmt.Create( block.CopyBlock( scope ),expr.Copy(),TLoopLabelDecl(loopLabel.Copy()) )
+		Else
+			Return New TRepeatStmt.Create( block.CopyBlock( scope ),expr.Copy(),Null )
+		End If
 	End Method
 	
 	Method OnSemant()