index af45a637eaca1fbbf4655e659cd3ec68f9eaaf18..9408eca32328248fd37b8454c30b99d663ad7ebd 100644 (file)
jvm_alloc_register_untyped(p -> rf, false);
jvm_generate(p, 0, 1, "aload_0");
jvm_generate(p, 1, 0, "invokespecial java/lang/Object/<init>()V");
+
+ /* Инициализация переменных объявленных в модуле */
+ oberon_object_t * x = ctx -> mod -> decl -> list -> next;
+ while(x != NULL)
+ {
+ if(x -> class == OBERON_CLASS_VAR)
+ {
+ if(x -> type -> class == OBERON_TYPE_ARRAY
+ || x -> type -> class == OBERON_TYPE_RECORD)
+ {
+ jvm_generate_new_static(p, x -> type);
+ jvm_generate_store(p, x -> type, x -> gen_var);
+ }
+ }
+ x = x -> next;
+ }
}
void