瀏覽代碼

* fix #41581 based on a patch by rasberryrabbit

florian 9 小時之前
父節點
當前提交
4e3e213652
共有 2 個文件被更改,包括 16 次插入0 次删除
  1. 1 0
      compiler/ncal.pas
  2. 15 0
      tests/webtbs/tw41581.pp

+ 1 - 0
compiler/ncal.pas

@@ -5772,6 +5772,7 @@ implementation
             inlineblock.free;
             inlineblock := nil;
             result:=n;
+            node_reset_flags(result,[],[tnf_pass1_done]);
           end;
 
 {$ifdef DEBUGINLINE}

+ 15 - 0
tests/webtbs/tw41581.pp

@@ -0,0 +1,15 @@
+{$mode objfpc}
+program project1;
+uses
+  Math;
+
+function Calc: Double; inline;
+begin
+  Result := Power(10, Floor(Log10(0.01)));
+end;
+
+begin
+  writeln(Calc);
+  if (Calc>0.0100001) or (Calc<0.0099999) then
+    halt(1);
+end.