After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 554594 - Using a struct with a ternary operation segfaults valac
Using a struct with a ternary operation segfaults valac
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
0.3.x
Other All
: Normal minor
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-01 17:05 UTC by Levi Bard
Modified: 2008-11-29 12:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Levi Bard 2008-10-01 17:05:15 UTC
Please describe the problem:
Using a struct with a ternary operation segfaults valac

Steps to reproduce:
using GLib;

namespace Blah {
	public struct Bar{ int x; Bar(){ x=0; } }

	public class Foo: GLib.Object {
		public static Bar bar(){ return (false? Bar(): Bar()); }
		
		public static int main() {
			return 0;
		}// main
	}// Foo
}// Blah


Actual results:
Segmentation fault.

Expected results:
Completed compilation.

Does this happen every time?
Yes.

Other information:
Comment 1 Jürg Billeter 2008-11-29 12:21:06 UTC
2008-11-29  Jürg Billeter  <j@bitron.ch>

	* vala/Makefile.am:
	* vala/valablock.vala:
	* vala/valacodenode.vala:
	* vala/valaconditionalexpression.vala:
	* vala/valadeclarationstatement.vala:
	* vala/valaexpression.vala:
	* vala/valanullchecker.vala:
	* vala/valastatementlist.vala:
	* gobject/valaccodebasemodule.vala:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodemodule.vala:

	Convert ternary conditionals into if statements,
	fixes bug 543870 and bug 554594

Fixed in r2083.