View Issue Details

IDProjectCategoryView StatusLast Update
0037750pas2jsrtlpublic2020-09-21 13:05
Reporterhenrique Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformPas2JsOSWindows 
Summary0037750: GetMethods
DescriptionI changed the GetMethods implementation to assemble the results array, depending on the class hierarchy.
TagsNo tags attached.
Fixed in Revision
Attached Files

Activities

henrique

2020-09-15 21:54

reporter  

Metodos.patch (1,001 bytes)   
From 1159301e17594ce29930454200ede5bad3ca07bf Mon Sep 17 00:00:00 2001
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com>
Date: Tue, 15 Sep 2020 16:49:49 -0300
Subject: [PATCH] Mudado o getmethods.

---
 packages/rtl/rtti.pas | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/rtl/rtti.pas b/packages/rtl/rtti.pas
index 8cda217..fc42b48 100644
--- a/packages/rtl/rtti.pas
+++ b/packages/rtl/rtti.pas
@@ -689,17 +689,18 @@ begin
     BaseClass := BaseClass.GetAncestor;
   end;
 
-  SetLength(Result, StructTypeInfo.MethodCount);
+  SetLength(Result, MethodCount);
 
   BaseClass := Self;
+  MethodCount := 0;
 
   while Assigned(BaseClass) do
   begin
     for A := 0 to Pred(BaseClass.StructTypeInfo.MethodCount) do
     begin
-      Dec(MethodCount);
-
       Result[MethodCount] := TRttiMethod.Create(BaseClass, BaseClass.StructTypeInfo.GetMethod(A));
+
+      Inc(MethodCount);
     end;
 
     BaseClass := BaseClass.GetAncestor;
-- 
2.28.0.windows.1

Metodos.patch (1,001 bytes)   

Issue History

Date Modified Username Field Change
2020-09-15 21:54 henrique New Issue
2020-09-15 21:54 henrique File Added: Metodos.patch
2020-09-16 23:52 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-09-16 23:52 Michael Van Canneyt Status new => assigned