Jelajahi Sumber

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 -

pierre 5 tahun lalu
induk
melakukan
cc46cc56e2
1 mengubah file dengan 6 tambahan dan 3 penghapusan
  1. 6 3
      compiler/ninl.pas

+ 6 - 3
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;