[Vala] conversion segfault



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello, fellow Valaists

I have the following example code which segfaults:

public int main(string[] argv){
    stdout.printf("hello world\n");
    uint64 test = 1;
    string x = "foobar"+(string)test;
    stdout.printf(x+"\n");
    return  0;
}

compiled with my valac 0.26.1, the result segfaults in line 4.
I can't imagine, this is intended behaviour.

Of course, the proper way to go for line 4 would be something like

    string x = "foobar%lld".printf(test);

Nevertheless i wonder, why the code segfaults, shouldn't there rather
be a type conversion error at compile time?

Sorry, i don't have a more recent 0.27 or 0.26.2 compiler at hand.


TIA, Grindhold
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJU1J8SAAoJEBuqgJs6izSE+JMQAJApxYTnuGmriXvbR5KLOAcv
ZTzJ1PbUKuGs76EewJYOS5lPX997y4DRBHPTCy7cALwaAhpNcKYAI+jb6QisUbP0
Fu5JLRFv7xjoTC560r3yuRNPRgeMTd9esE6siGTm1oMB35buxt1XOQ9bz1iZ28n2
vnFhaZZ3paOFBpAwVyn6lyNGmWnjquAfCc0Km1h/w94PGgFf3wAqSQugiG9dPG9U
afOiDG1R8JFLpdQEEHCZfSd6ohq9CPjBIgncHKuRxsrfFRkmJ6CuyMdMKvzqvXeq
PgqIQ2RiAm76lVFMH4XCfsfhupVz8oDNACqaI1AEnKNRizdWBi8kqsuBZBJtlmz6
mJC2fim8ZIDUJo75/aJnUPTHFKrHFp307kkkp5AW4ihGQtn8Ef4q9Z0aLcAO4sSC
vGSdnG3hysrlUxLwozoIx1cv47IHJ+A/Nn8tO//riFsrwa821dh2wioWVdq58e7b
T5wQ+Q+nsb21LoQpd+bw2vDlRhmjJcAWXoXG/6YFPIU1zi2n9jTZ3/75m4btG6P1
sS3L99w22KldN1JDlCCWkH+6bnrQfwOP0YArQbtP7zVWEZCmKtH3ncXrAdrkjhIp
hcHAzgtsrH2fggQ9VGPMGrVVz5ALTxOMt2qUKtXSoC4LtlNDVFEXAtxvYIj5REjD
L2rx0BsJxwRq+OQfRsal
=H26t
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]