소스 검색

* synchronized with trunk

git-svn-id: branches/wasm@46310 -
nickysn 5 년 전
부모
커밋
2a40acba19
6개의 변경된 파일22개의 추가작업 그리고 12개의 파일을 삭제
  1. 1 0
      .gitattributes
  2. 2 4
      compiler/m68k/aasmcpu.pas
  3. 5 5
      compiler/nadd.pas
  4. 4 2
      packages/fcl-json/src/fpjsonrtti.pp
  5. 6 0
      tests/webtbs/tw37508.pp
  6. 4 1
      utils/pas2js/httpcompiler.pp

+ 1 - 0
.gitattributes

@@ -18447,6 +18447,7 @@ tests/webtbs/tw37449.pp svneol=native#text/pascal
 tests/webtbs/tw37468.pp svneol=native#text/pascal
 tests/webtbs/tw37477.pp svneol=native#text/pascal
 tests/webtbs/tw37493.pp svneol=native#text/pascal
+tests/webtbs/tw37508.pp svneol=native#text/pascal
 tests/webtbs/tw3751.pp svneol=native#text/plain
 tests/webtbs/tw3758.pp svneol=native#text/plain
 tests/webtbs/tw3764.pp svneol=native#text/plain

+ 2 - 4
compiler/m68k/aasmcpu.pas

@@ -556,8 +556,7 @@ type
           R_ADDRESSREGISTER :
             result:=taicpu.op_ref_reg(A_MOVE,S_L,ref,r);
           R_FPUREGISTER :
-            // no need to handle sizes here
-            result:=taicpu.op_ref_reg(A_FMOVE,S_FS,ref,r);
+            result:=taicpu.op_ref_reg(A_FMOVE,fpuregopsize,ref,r);
           else
             internalerror(200602011);
         end;
@@ -572,8 +571,7 @@ type
           R_ADDRESSREGISTER :
             result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
           R_FPUREGISTER :
-            // no need to handle sizes here
-            result:=taicpu.op_reg_ref(A_FMOVE,S_FS,r,ref);
+            result:=taicpu.op_reg_ref(A_FMOVE,fpuregopsize,r,ref);
           else
             internalerror(200602012);
         end;

+ 5 - 5
compiler/nadd.pas

@@ -737,7 +737,7 @@ implementation
               begin
                 case nodetype of
                   muln:
-                   result := cunaryminusnode.create(left.getcopy);
+                   result := ctypeconvnode.create_internal(cunaryminusnode.create(left.getcopy),left.resultdef);
                   else
                     ;
                 end;
@@ -818,9 +818,9 @@ implementation
               begin
                 case nodetype of
                   addn,orn,xorn:
-                   result := right.getcopy;
+                    result := right.getcopy;
                   subn:
-                   result := cunaryminusnode.create(right.getcopy);
+                    result := ctypeconvnode.create_internal(cunaryminusnode.create(right.getcopy),right.resultdef);
                   andn,muln:
                     begin
                       if (cs_opt_level4 in current_settings.optimizerswitches) or
@@ -844,7 +844,7 @@ implementation
               begin
                 case nodetype of
                   muln:
-                   result := cunaryminusnode.create(right.getcopy);
+                   result := ctypeconvnode.create_internal(cunaryminusnode.create(right.getcopy),right.resultdef);
                   else
                     ;
                 end;
@@ -976,7 +976,7 @@ implementation
                           end;
                       subn:
                         begin
-                          result:=cunaryminusnode.create(right.getcopy);
+                          result:=ctypeconvnode.create_internal(cunaryminusnode.create(right.getcopy),right.resultdef);
                           exit;
                         end;
                       else

+ 4 - 2
packages/fcl-json/src/fpjsonrtti.pp

@@ -113,7 +113,7 @@ Type
   TJSONRestorePropertyEvent = Procedure (Sender : TObject; AObject : TObject; Info : PPropInfo; AValue : TJSONData; Var Handled : Boolean) of object;
   TJSONPropertyErrorEvent = Procedure (Sender : TObject; AObject : TObject; Info : PPropInfo; AValue : TJSONData; Error : Exception; Var Continue : Boolean) of object;
   TJSONGetObjectEvent = Procedure (Sender : TOBject; AObject : TObject; Info : PPropInfo; AData : TJSONObject; DataName : TJSONStringType; Var AValue : TObject);
-  TJSONDestreamOption = (jdoCaseInsensitive,jdoIgnorePropertyErrors);
+  TJSONDestreamOption = (jdoCaseInsensitive,jdoIgnorePropertyErrors,jdoIgnoreNulls);
   TJSONDestreamOptions = set of TJSONDestreamOption;
 
   TJSONDeStreamer = Class(TJSONFiler)
@@ -396,7 +396,9 @@ begin
       If B then
         exit;
       end;
-    DoRestoreProperty(AObject,PropInfo,PropData);
+    if (PropData.JSONType=jtNull) then
+      if Not (jdoIgnoreNulls in Options) then
+        DoRestoreProperty(AObject,PropInfo,PropData);
   except
     On E : Exception do
       If Assigned(FOnPropError) then

+ 6 - 0
tests/webtbs/tw37508.pp

@@ -0,0 +1,6 @@
+{ %OPT=-O3 }
+var a, b : integer;
+begin
+  b := 0;
+  b := b - a - a { `b := b - a` won't trigger the error }
+end.

+ 4 - 1
utils/pas2js/httpcompiler.pp

@@ -284,6 +284,8 @@ end;
 
 procedure THTTPCompilerApplication.LoadDefaultMimeTypes;
 begin
+  MimeTypes.LoadKnownTypes;
+  // To be sure
   MimeTypes.AddType('application/xhtml+xml','xhtml;xht');
   MimeTypes.AddType('text/html','html;htm');
   MimeTypes.AddType('text/plain','txt');
@@ -296,6 +298,7 @@ begin
   MimeTypes.AddType('image/jp2','jp2');
   MimeTypes.AddType('image/tiff','tiff;tif');
   MimeTypes.AddType('application/pdf','pdf');
+  MimeTypes.AddType('text/css','css');
 end;
 
 constructor THTTPCompilerApplication.Create(AOWner: TComponent);
@@ -366,7 +369,7 @@ end;
 
 procedure THTTPCompilerApplication.AddToStatus(AEntry: TDirectoryEntry; AEvents: TFileEvents);
 
-Var
+Var  
   O : TJSONObject;
   FN : String;