|
@@ -14125,6 +14125,19 @@ end;
|
|
|
|
|
|
procedure TPasResolver.BI_LowHigh_OnEval(Proc: TResElDataBuiltInProc;
|
|
|
Params: TParamsExpr; Flags: TResEvalFlags; out Evaluated: TResEvalValue);
|
|
|
+
|
|
|
+ function IsDynArrayConstExpr(IdentEl: TPasElement): boolean;
|
|
|
+ begin
|
|
|
+ Result:=false;
|
|
|
+ if not (IdentEl is TPasVariable) then exit;
|
|
|
+ if not (TPasVariable(IdentEl).Expr is TPasExpr) then exit;
|
|
|
+
|
|
|
+ if (IdentEl.ClassType=TPasConst) and TPasConst(IdentEl).IsConst then
|
|
|
+ exit(true);
|
|
|
+ if fExprEvaluator.IsConst(Params) then
|
|
|
+ exit(true); // a const refers an initial value
|
|
|
+ end;
|
|
|
+
|
|
|
var
|
|
|
Param: TPasExpr;
|
|
|
ParamResolved: TPasResolverResult;
|
|
@@ -14154,8 +14167,7 @@ begin
|
|
|
// dyn or open array
|
|
|
if Proc.BuiltIn=bfLow then
|
|
|
Evaluated:=TResEvalInt.CreateValue(0)
|
|
|
- else if (ParamResolved.IdentEl is TPasVariable)
|
|
|
- and (TPasVariable(ParamResolved.IdentEl).Expr is TPasExpr) then
|
|
|
+ else if IsDynArrayConstExpr(ParamResolved.IdentEl) then
|
|
|
begin
|
|
|
Expr:=TPasVariable(ParamResolved.IdentEl).Expr;
|
|
|
if Expr is TArrayValues then
|