瀏覽代碼

* mark classes representing units as "final", since you're not supposed to
descend from them

git-svn-id: branches/jvmbackend@18446 -

Jonas Maebe 14 年之前
父節點
當前提交
2514c4ddb1
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      compiler/agjasmin.pas

+ 3 - 2
compiler/agjasmin.pas

@@ -538,8 +538,9 @@ implementation
         if not assigned(obj) then
         if not assigned(obj) then
           begin
           begin
             { fake class type for unit -> name=unitname and
             { fake class type for unit -> name=unitname and
-              superclass=java.lang.object }
-            AsmWrite('.class public ');
+              superclass=java.lang.object, make final so you cannot descend
+              from it }
+            AsmWrite('.class final public ');
             if assigned(current_module.namespace) then
             if assigned(current_module.namespace) then
               AsmWrite(current_module.namespace^+'.');
               AsmWrite(current_module.namespace^+'.');
             AsmWriteln(current_module.realmodulename^);
             AsmWriteln(current_module.realmodulename^);