From cc46cc56e25b6711c7c11999c25d2f86c6602f25 Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 5 Aug 2020 06:33:11 +0000 Subject: [PATCH] Merge invalid typecast fix 39988 ------------------------------------------------------------------------ r39988 | pierre | 2018-10-19 23:04:55 +0000 (Fri, 19 Oct 2018) | 1 line Fix wrong explicit typecast that lead to memory corruption in first_sqr_real ------------------------------------------------------------------------ --- Merging r39988 into '.': U compiler/ninl.pas --- Recording mergeinfo for merge of r39988 into '.': U . git-svn-id: branches/fixes_3_2@46238 - --- compiler/ninl.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/ninl.pas b/compiler/ninl.pas index a21c370781..454d576599 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -4081,6 +4081,8 @@ implementation end; function tinlinenode.first_sqr_real : tnode; + var + callnode : tcallnode; begin {$ifndef cpufpemu} { this procedure might be only used for cpus definining cpufpemu else @@ -4089,9 +4091,10 @@ implementation {$endif cpufpemu} { create the call to the helper } { on entry left node contains the parameter } - result := ctypeconvnode.create(ccallnode.createintern('fpc_sqr_real', - ccallparanode.create(left,nil)),resultdef); - include(tcallnode(result).callnodeflags,cnf_check_fpu_exceptions); + callnode:=ccallnode.createintern('fpc_sqr_real', + ccallparanode.create(left,nil)); + result := ctypeconvnode.create(callnode,resultdef); + include(callnode.callnodeflags,cnf_check_fpu_exceptions); left := nil; end;