diff --git a/src/program.c b/src/program.c index 9e6047a5f12d5b1c814f9c597a4330ebc24f867e..50274a775fdb8e1f8f521a57c5d3836ce0c132e1 100644 --- a/src/program.c +++ b/src/program.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: program.c,v 1.73 1998/04/09 02:49:48 hubbe Exp $"); +RCSID("$Id: program.c,v 1.74 1998/04/10 04:49:55 hubbe Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -769,7 +769,7 @@ struct program *end_first_pass(int finish) /* Collect references to inherited __INIT functions */ - for(e=1;e<new_program->num_inherits;e++) + for(e=new_program->num_inherits-1;e>1;e--) { int id; if(new_program->inherits[e].inherit_level!=1) continue; @@ -777,9 +777,9 @@ struct program *end_first_pass(int finish) if(id!=-1) { init_node=mknode(F_ARG_LIST, - init_node, mkcastnode(void_type_string, - mkapplynode(mkidentifiernode(id),0))); + mkapplynode(mkidentifiernode(id),0)), + init_node); } } diff --git a/src/testsuite.in b/src/testsuite.in index 87b152a1d9c4ddc195279d2e5c580c4583997355..50f4989717be97c0326300efd8cf2e3c6245bf36 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -1,4 +1,4 @@ -test_true([["$Id: testsuite.in,v 1.86 1998/04/09 21:11:03 hubbe Exp $"]]) +test_true([["$Id: testsuite.in,v 1.87 1998/04/10 04:49:55 hubbe Exp $"]]) test_eq(1e1,10.0) test_eq(1E1,10.0) test_eq(1e+1,10.0) @@ -11,6 +11,9 @@ test_true([[1.0e-40]]) test_eq([[#"foo bar"]],[["foo\nbar"]]) test_true([[stringp(#string "Makefile")]]) +test_any([[class Bar { array(int) foo = ({}); }; class Foo { inherit Bar; array(int) foo = ({1}); }; return sizeof(Foo()->foo);]],1) + + test_any([[object(Stdio.File) f; f=Stdio.File(); return 1]],1) test_compile([[int t=gauge { string foo; };]]) test_compile_any([[class { object(Stdio.FILE) f; void create() { f=Stdio.FILE(); }}]])