View Issue Details

IDProjectCategoryView StatusLast Update
0037750pas2jsrtlpublic2020-10-06 13:17
Reporterhenrique Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformPas2JsOSWindows 
Fixed in Versiontrunk 
Summary0037750: GetMethods
DescriptionI changed the GetMethods implementation to assemble the results array, depending on the class hierarchy.
TagsNo tags attached.
Fixed in Revision890
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)   

henrique

2020-10-05 22:43

reporter   ~0126105

This correct and can be applied?

Michael Van Canneyt

2020-10-06 10:21

administrator   ~0126106

Applied, please check because the patch no longer applied cleanly.
Thanks for the patch.

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
2020-10-05 22:43 henrique Note Added: 0126105
2020-10-06 10:21 Michael Van Canneyt Status assigned => resolved
2020-10-06 10:21 Michael Van Canneyt Resolution open => fixed
2020-10-06 10:21 Michael Van Canneyt Fixed in Version => trunk
2020-10-06 10:21 Michael Van Canneyt Fixed in Revision => 890
2020-10-06 10:21 Michael Van Canneyt Note Added: 0126106