Преглед изворни кода

* temporarily fix #37034 by disabling the problematic optimization until the real cause is fixed

git-svn-id: trunk@45655 -
florian пре 5 година
родитељ
комит
62c417c8bf
3 измењених фајлова са 31 додато и 0 уклоњено
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/nbas.pas
  3. 28 0
      tests/webtbs/tw37034.pp

+ 1 - 0
.gitattributes

@@ -18318,6 +18318,7 @@ tests/webtbs/tw3695.pp svneol=native#text/plain
 tests/webtbs/tw3697.pp svneol=native#text/plain
 tests/webtbs/tw3700.pp svneol=native#text/plain
 tests/webtbs/tw37013.pp svneol=native#text/plain
+tests/webtbs/tw37034.pp svneol=native#text/pascal
 tests/webtbs/tw37060.pp svneol=native#text/plain
 tests/webtbs/tw37062.pp svneol=native#text/pascal
 tests/webtbs/tw3708.pp svneol=native#text/plain

+ 2 - 0
compiler/nbas.pas

@@ -742,6 +742,7 @@ implementation
                 ;
             end;
           end;
+{$ifdef break_inlining}
         { simple sequence of tempcreate, assign and return temp.? }
         if GetStatements(left,a) and
           (a[0].left.nodetype=tempcreaten) and
@@ -764,6 +765,7 @@ implementation
             firstpass(result);
             exit;
           end;
+{$endif break_inlining}
       end;
 
 

+ 28 - 0
tests/webtbs/tw37034.pp

@@ -0,0 +1,28 @@
+program Test;
+
+{$mode objfpc}
+{$h+}
+
+uses
+  SysUtils;
+
+{$assertions on}
+
+function Suffix: string; inline;
+begin
+  Result := 'Post';
+end;
+
+const
+  Expected = 'Pre_Mid_Post';
+var
+  s, t: string;
+begin
+  DefaultSystemCodePage:=1252;
+  writeln(DefaultSystemCodePage);
+  writeln(StringCodePage(suffix));
+  s := 'Pre';
+  t := s + '_Mid_' + Suffix;
+  Assert(t = Expected,format('Expected "%s", Got: "%s"',[Expected,t]));
+  writeln('Ok');
+end.