From 92510ebe0838d954069991d4ee798bbc8ff325be Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Wed, 16 Aug 2017 10:30:34 +0000 Subject: [PATCH] fcl-passrc: resolver: fixed reading constant $8000000000000000 git-svn-id: trunk@36927 - --- packages/fcl-passrc/src/pasresolveeval.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/fcl-passrc/src/pasresolveeval.pas b/packages/fcl-passrc/src/pasresolveeval.pas index 4508d460b2..2e7ab61600 100644 --- a/packages/fcl-passrc/src/pasresolveeval.pas +++ b/packages/fcl-passrc/src/pasresolveeval.pas @@ -2899,6 +2899,7 @@ begin writeln('TResExprEvaluator.EvalSetExpr Expr=',GetObjName(Expr),' length(ExprArray)=',length(ExprArray)); {$ENDIF} Result:=TResEvalSet.Create; + if Expr=nil then ; Value:=nil; OnlyConstElements:=true; ok:=false; @@ -3375,9 +3376,12 @@ begin writeln('TResExprEvaluator.Eval Int=',Int,' Value="',TPrimitiveExpr(Expr).Value,'"'); {$ENDIF} if (Int<0) and (Pos('-',TPrimitiveExpr(Expr).Value)<1) then - RaiseInternalError(20170802141254,'bug in FPC str()'); - Result:=TResEvalInt.CreateValue(Int); - exit; + // FPC str() converts $8000000000000000 to a negative int64 -> ignore + else + begin + Result:=TResEvalInt.CreateValue(Int); + exit; + end; end; // try MaxPrecUInt val(TPrimitiveExpr(Expr).Value,UInt,Code);