From 75251913b11369213c721aa496e5e1b34778cc97 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 16 Aug 2018 20:45:36 +0000 Subject: [PATCH] * properly pass execution weight in SetExecutionWeight git-svn-id: trunk@39622 - --- compiler/optutils.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/optutils.pas b/compiler/optutils.pas index 9b9b39d994..1a55afd894 100644 --- a/compiler/optutils.pas +++ b/compiler/optutils.pas @@ -359,11 +359,12 @@ unit optutils; function SetExecutionWeight(var n: tnode; arg: pointer): foreachnoderesult; var - Weight : AWord absolute arg; + Weight : AWord; i : Integer; begin Result:=fen_false; n.allocoptinfo; + Weight:=PAWord(arg)^; case n.nodetype of casen: begin @@ -392,10 +393,10 @@ unit optutils; { The code below emits two warnings if ptruint and aword are the same type } {$warn 4044 off} {$warn 6018 off} - if ptruint(arg) > high(aword) then + if PAWord(arg)^ > high(aword) then n.optinfo^.executionweight:=high(AWord) else - n.optinfo^.executionweight:=AWord(ptruint(arg)); + n.optinfo^.executionweight:=PAWord(arg)^; {$pop} end; end; @@ -404,7 +405,7 @@ unit optutils; procedure CalcExecutionWeights(p : tnode;Initial : AWord = 100); begin if assigned(p) then - foreachnodestatic(pm_postprocess,p,@SetExecutionWeight,Pointer(ptruint(Initial))); + foreachnodestatic(pm_postprocess,p,@SetExecutionWeight,Pointer(@Initial)); end;