View Issue Details

IDProjectCategoryView StatusLast Update
0037235FPCPackagespublic2021-04-11 19:04
ReporterMartin Jülich Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0.4 
Target Version3.2.2Fixed in Version3.2.2 
Summary0037235: Symbolic.QuickEvaluate error with 1 variable
DescriptionIf you use exactly one variable an exception is raised because the code to process the variables is not executed.

function QuickEvaluate(formula:ansistring;variablenames : array of ansistring;variablevalues:array of const):Double;
[...]
         Eval:=TEvaluator.Create(Varname,Expr);
         try
           if high(variablenames)>0 then //<<<<<<<<<<<< this should be "length(variablenames)"
             begin
               for i:=low(variablenames) to high(variablenames) do
                 begin
                   j:=symvars.indexof(variablenames[i]);
                   if j<>-1 then
                     begin
TagsNo tags attached.
Fixed in Revision45676 merged 45703
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

delfion

2020-06-21 19:52

reporter   ~0123502

Index: packages/symbolic/src/symbolic.pas
===================================================================
--- packages/symbolic/src/symbolic.pas (revision 45668)
+++ packages/symbolic/src/symbolic.pas (working copy)
@@ -504,7 +504,7 @@
        try
          Eval:=TEvaluator.Create(Varname,Expr);
          try
- if high(variablenames)>0 then
+ if length(variablenames)>0 then
              begin
                for i:=low(variablenames) to high(variablenames) do
                  begin

Marco van de Voort

2020-06-22 12:35

manager   ~0123513

should be high(x)>=0 as high is -1 for empty open arrays. Fixed

Issue History

Date Modified Username Field Change
2020-06-21 19:22 Martin Jülich New Issue
2020-06-21 19:52 delfion Note Added: 0123502
2020-06-22 12:35 Marco van de Voort Assigned To => Marco van de Voort
2020-06-22 12:35 Marco van de Voort Status new => resolved
2020-06-22 12:35 Marco van de Voort Resolution open => fixed
2020-06-22 12:35 Marco van de Voort Fixed in Revision => 45676
2020-06-22 12:35 Marco van de Voort FPCTarget => -
2020-06-22 12:35 Marco van de Voort Note Added: 0123513
2021-04-11 18:29 Marco van de Voort Fixed in Version => 3.2.2
2021-04-11 18:29 Marco van de Voort Target Version => 3.2.2
2021-04-11 18:29 Marco van de Voort FPCTarget - => 3.2.2
2021-04-11 19:04 Marco van de Voort Fixed in Revision 45676 => 45676 merged 45703