[Vala] Incorrect enum / switch usage causing segfault in 0.9.4 (and previous)
- From: Dru Moore <dru dru-id co uk>
- To: vala-list gnome org
- Subject: [Vala] Incorrect enum / switch usage causing segfault in 0.9.4 (and previous)
- Date: Sun, 8 Aug 2010 22:37:35 +0100
This came up because of a stupid error in my code but, incorrect (i.e.
stupid!) use of an enum in a switch statement is segfaulting the code
generator on both 64bit x86 and armel platforms on Linux. As I say
it's clearly stupid on the part of the programmer but it should not
compile rather than segfault I guess.
Below is the smallest example I could devise that exhibits the
segfault in 0.9.4, but the behaviour is consistent as complexity
grows.
I've filed it as bug https://bugzilla.gnome.org/show_bug.cgi?id=626397
but will remove it if deemed inappropriate.
dru
public static int main(string[] args) {
Test test = {TheEnumerator.ONE};
switch (TheEnumerator) { // clearly should be test.the_enumerator !
case TheEnumerator.ONE:
break;
default:
break;
}
return 0;
}
public enum TheEnumerator {
ONE
}
public struct Test {
TheEnumerator the_enumerator;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]