From: DeaDDooMER Date: Wed, 23 Aug 2017 10:15:27 +0000 (+0300) Subject: JVM: наличие VAR-парамеров отражается в имени класса процедур X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=dd629f9f9b42dcca96ef4fc58df5ccb2e332b65b;p=dsw-obn.git JVM: наличие VAR-парамеров отражается в имени класса процедур --- diff --git a/Test.obn b/Test.obn index 3c862c1..6fae529 100644 --- a/Test.obn +++ b/Test.obn @@ -1,28 +1,3 @@ MODULE Test; -TYPE - Object = RECORD - mth : PROCEDURE; - END; - -VAR - p : PROCEDURE; - o, a : Object; - -PROCEDURE X; -END X; - -PROCEDURE Z(VAR g : Object); -BEGIN - g.mth; -END Z; - -BEGIN - p := X; - ASSERT(p # NIL); - o.mth := X; - ASSERT(o.mth # NIL); - a := o; - ASSERT(a.mth # NIL); - Z(a); END Test. diff --git a/src/backends/jvm/generator-jvm-basic.c b/src/backends/jvm/generator-jvm-basic.c index 855a617..61088af 100644 --- a/src/backends/jvm/generator-jvm-basic.c +++ b/src/backends/jvm/generator-jvm-basic.c @@ -375,6 +375,7 @@ jvm_get_class_full_name(oberon_type_t * type) name = new_string("SYSTEM$PROCEDURE"); char * desc; + char * spec; desc = jvm_get_descriptor_safe(type -> base); name = new_string("%s$%s", name, desc); @@ -383,8 +384,13 @@ jvm_get_class_full_name(oberon_type_t * type) for(int i = 0; i < num; i++) { + spec = ""; + if(arg -> class == OBERON_CLASS_VAR_PARAM) + { + spec = "VAR"; + } desc = jvm_get_descriptor_safe(arg -> type); - name = new_string("%s%s", name, desc); + name = new_string("%s%s%s", name, spec, desc); arg = arg -> next; }