=== modified file 'gobject/valaccodeclassbinding.vala'
--- gobject/valaccodeclassbinding.vala	2008-05-17 02:39:37 +0000
+++ gobject/valaccodeclassbinding.vala	2008-05-20 06:49:21 +0000
@@ -111,6 +111,11 @@
 			}
 		}
 
+		if (!cl.is_static && cl.base_class == null && cl.get_fields ().size == 0) {
+			// Add dummy member so that the struct size is nonzero. See bug 533977.
+			codegen.instance_struct.add_field ("char", "dummy");
+		}
+
 		if (is_gtypeinstance) {
 			if (cl.source_reference.file.cycle == null) {
 				decl_frag.append (new CCodeTypeDefinition ("struct %s".printf (codegen.type_struct.name), new CCodeVariableDeclarator ("%sClass".printf (cl.get_cname ()))));

=== modified file 'tests/classes.exp'
--- tests/classes.exp	2008-05-03 02:42:41 +0000
+++ tests/classes.exp	2008-05-20 06:53:57 +0000
@@ -6,6 +6,7 @@
 ClassWithCreationMethod
 new ClassWithNamedCreationMethod ()
 ClassWithNamedCreationMethod
+ClassWithNoFields
 new SimpleGTypeInstanceClass ()
 new DerivedGTypeInstanceClass ()
 new PublicGTypeInstanceClass ()

=== modified file 'tests/classes.vala'
--- tests/classes.vala	2008-05-03 02:42:41 +0000
+++ tests/classes.vala	2008-05-20 06:53:09 +0000
@@ -34,6 +34,12 @@
 	public int field;
 }
 
+class ClassWithNoFields {
+	public void print() {
+		stdout.printf("ClassWithNoFields\n");
+	}
+}
+
 class SimpleGTypeInstanceClass : TypeInstance {
 }
 
@@ -91,6 +97,8 @@
 		var class_with_creation_method = new ClassWithCreationMethod ();
 		stdout.printf ("new ClassWithNamedCreationMethod ()\n");
 		var class_with_named_creation_method = new ClassWithNamedCreationMethod.named ();
+		var class_with_no_fields = new ClassWithNoFields ();
+		class_with_no_fields.print ();
 
 		stdout.printf ("new SimpleGTypeInstanceClass ()\n");
 		var simple_gtypeinstance_class = new SimpleGTypeInstanceClass ();

