GNOME Bugzilla – Bug 660991
Segfault when FloatingType misses rank
Last modified: 2018-05-14 10:00:41 UTC
Created attachment 198344 [details] valac -C --vapidir=. --pkg=foo foo.vala I used to hack complex numbers into Vala by doing this: [SimpleType] [FloatingType] [CCode(cheader_filename = "complex.h", cname = "complex double")] public struct complex { } Valgrind says: Invalid read of size 4 at 0x501D858: vala_struct_get_rank (in /usr/lib/libvala-0.14.so.0.0.0) by 0x501247C: vala_semantic_analyzer_get_arithmetic_result_type (in /usr/lib/libvala-0.14.so.0.0.0) It seems that the correct way now is [FloatingType(rank = 3)] A error message would be nice.
Thanks for your bug report. Not sure if we want a default value or an error there.
Created attachment 371991 [details] [review] vala: Don't return null if no rank attribute was found There was already an error message introduced with 3158ae7a0f990b44f114d51498636e669609af0d
Attachment 371991 [details] pushed as 5bdf8f5 - vala: Don't return null if no rank attribute was found