DEADSOFTWARE

JVM: исправлен конфлик имён локальных и глобальных процедур
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Wed, 27 Sep 2017 18:03:22 +0000 (21:03 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Wed, 27 Sep 2017 18:03:22 +0000 (21:03 +0300)
Test.obn
src/backends/jvm/generator-jvm-basic.c
tests/Test29.obn

index da60894a8f758fa1ea09b7ef7f8195caa7367b55..22a2a55a2296d4cb933c58e7bf882acf1207e69e 100644 (file)
--- a/Test.obn
+++ b/Test.obn
@@ -1,10 +1,14 @@
 MODULE Test;
 
-PROCEDURE A;
+PROCEDURE A(a : INTEGER);
+  VAR
+    x : INTEGER;
 END A;
 
-PROCEDURE B;
-  PROCEDURE A;
+PROCEDURE B(b : SHORTINT);
+  PROCEDURE A(c : LONGINT);
+    VAR
+      y : ARRAY 3 OF INTEGER;
   END A;
 END B;
 
index 033b84227d1eebfb4bbda213e94e19e889229f78..2088559c7e7089b6609e4857179125f70cda025e 100644 (file)
@@ -330,13 +330,17 @@ jvm_get_field_full_name(oberon_object_t * x)
        {
                case OBERON_CLASS_VAR:
                        return new_string("%s/%s", x -> module -> name, jvm_get_name(x));
+                       break;
                case OBERON_CLASS_PROC:
                        return new_string("%s/%s", x -> module -> name, jvm_get_name(x));
+                       break;
                case OBERON_CLASS_FIELD:
                        parent = jvm_get_class_full_name(x -> parent_type);
                        return new_string("%s/%s", parent, jvm_get_name(x));
+                       break;
                case OBERON_CLASS_MODULE:
                        return new_string(x -> module -> name);
+                       break;
                default:
                        gen_error("jvm_get_field_full_name: wat");
                        break;
@@ -351,13 +355,18 @@ jvm_get_field_full_name_safe(oberon_object_t * x)
        switch(x -> class)
        {
                case OBERON_CLASS_VAR:
-               case OBERON_CLASS_PROC:
                        return new_string("%s$%s", x -> module -> name, x -> name);
+                       break;
+               case OBERON_CLASS_PROC:
+                       return new_string("%s$%s", x -> module -> name, jvm_get_name(x));
+                       break;
                case OBERON_CLASS_FIELD:;
                        char * rec_name = jvm_get_class_full_name(x -> parent_type);
                        return new_string("%s$%s", rec_name, x -> name);
+                       break;
                case OBERON_CLASS_MODULE:
                        return new_string(x -> module -> name);
+                       break;
                default:
                        gen_error("jvm_get_field_full_name: wat");
                        break;
index ab7e493a971b4bbf43cd7d4527a58fe94a89b601..1df5da2fc7652d110c487223b4bcfcfb991beb7e 100644 (file)
@@ -1,10 +1,14 @@
 MODULE Test29;
 
-PROCEDURE A;
+PROCEDURE A(a : INTEGER);
+  VAR
+    x : INTEGER;
 END A;
 
-PROCEDURE B;
-  PROCEDURE A;
+PROCEDURE B(b : SHORTINT);
+  PROCEDURE A(c : LONGINT);
+    VAR
+      y : ARRAY 3 OF INTEGER;
   END A;
 END B;