Error threshold causes endless compilation
Posted: Sat Jun 22, 2013 10:45 am
I have found a very specific case in which the compiler locks-up.
Operating System: Win 7 x86-64
Compiler Version: Cobra 0.9.4
IDE: Xamarin - latest
Compilation of this incorrect code simply reports the errors. However, if the last line is uncommented, the compiler will completely lock up and the IDE then has to be closed (compilation cannot be cancelled).
To prove that this is not a case that involves only XNA, the following code will also cause a lock-up:
The second code is obviously an extreme corner-case, but it proves that you can lock the compiler up with any code.
Operating System: Win 7 x86-64
Compiler Version: Cobra 0.9.4
IDE: Xamarin - latest
- Code: Select all
@args -lib:"C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86"
@ref 'Microsoft.Xna.Framework.Graphics'
use Microsoft.Xna.Framework.Graphics
class Program
var blendState as Microsoft.Xna.Framework.Graphics.BlendState
def main
.blendState = BlendState()
.blendState.AlphaBlendFunction = BlendState.AlphaBlend.AlphaBlendFunction
.blendState.AlphaDestinationBlend = BlendState.AlphaBlend.AlphaDestinationBlend
.blendState.AlphaSourceBlend = BlendState.AlphaBlend.AlphaSourceBlend
.blendState.BlendFactor = BlendState.AlphaBlend.BlendFactor
.blendState.ColorBlendFunction = BlendState.AlphaBlend.ColorBlendFunction
.blendState.ColorDestinationBlend = BlendState.AlphaBlend.ColorDestinationBlend
.blendState.ColorSourceBlend = BlendState.AlphaBlend.ColorSourceBlend
.blendState.ColorWriteChannels = BlendState.AlphaBlend.ColorWriteChannels
#.blendState.ColorWriteChannels1 = BlendState.AlphaBlend.ColorWriteChannels1
Compilation of this incorrect code simply reports the errors. However, if the last line is uncommented, the compiler will completely lock up and the IDE then has to be closed (compilation cannot be cancelled).
To prove that this is not a case that involves only XNA, the following code will also cause a lock-up:
- Code: Select all
class Program
def main
variable = 15
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
The second code is obviously an extreme corner-case, but it proves that you can lock the compiler up with any code.