constructor can't be chained from 'if'
Submitted by Ilya Mezhirov
Link to original bug (#692019)
Description
valac foo.vala; ./foo -> Segmentation fault
A problem arises when a chain constructor call is inside an if. This code gives segmentation fault.
class Foo
{
int x;
public Foo()
{
x = 1;
}
public Foo.maybe_chain(bool chain)
{
if (chain)
this();
x = 3;
print("b\n");
}
}
void main()
{
new Foo.maybe_chain(false);
}
The compiler only creates self inside if:
if (_tmp0_) {
self = (Foo*) foo_construct (object_type);
}
Version: 0.18.x