Explorar o código

Fix wrong explicit typecast that lead to memory corruption in first_sqr_real

git-svn-id: trunk@39988 -
pierre %!s(int64=6) %!d(string=hai) anos
pai
achega
7d7f966ccb
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      compiler/ninl.pas

+ 6 - 3
compiler/ninl.pas

@@ -4103,6 +4103,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
@@ -4111,9 +4113,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;