Posts tagged compiler
Posts tagged compiler
When I compile the following code with Mono 2.6.7, the compiler crashes.
class V<T>
{
T[] d;
T this [int i]
{
get { return d[0]; }
}
}
class C
{
void M()
{
V<int> m;
var x = m[0];
}
}
It is a short piece of code (101 non-whitespace characters) that still can illustrate the problem.
But is it minimal (ignoring whitespace)? A little bit of playing around gave me this:
class V<T>
{
T[] d;
T this [int i]
{
get { return d[0]; }
}
}
class C
{
void M()
{
V<int> m;
x = m[0];
}
}
Just 98 characters! Can you come up with something smaller that triggers this bug? Something smaller that triggers another bug?
Niecza is a Perl 6 compiler written in C#, targetting the Common Language Runtime.
There is also a post by Solomon Foster about Niecza: Niecza seems to be much faster than Rakudo for some numerical computations. Nice!
Csmith is a tool that can generate random C programs that statically and dynamically conform to theĀ C99 standard. Thus, it is useful for stress-testing compilers, static analyzers, and other tools that process C code. Csmith has found bugs in every tool that it has tested, and over the last several years we have used it to find and report more than 350 previously-unknown compiler bugs.