瀏覽代碼

--- Merging r20190 into '.':
A tests/webtbs/tw21151.pp
U compiler/ncon.pas
U compiler/symsym.pas
U compiler/ppu.pas
--- Merging r20484 into '.':
U compiler/finput.pas
--- Merging r20488 into '.':
U compiler/msgtxt.inc
U compiler/msgidx.inc
U compiler/scanner.pas
U compiler/msg/errore.msg
--- Merging r20499 into '.':
U compiler/i386/cpupara.pas
--- Merging r20501 through r20502 into '.':
U compiler/ninl.pas
U compiler/optdead.pas
--- Merging r20508 into '.':
A tests/webtbf/tw21078.pp
U compiler/nld.pas
--- Merging r20959 into '.':
U compiler/htypechk.pas
--- Merging r21248 into '.':
G compiler/msgtxt.inc
G compiler/msgidx.inc
G compiler/msg/errore.msg

git-svn-id: branches/fixes_2_6@22643 -

Jonas Maebe 12 年之前
父節點
當前提交
a6953a2cca

+ 2 - 0
.gitattributes

@@ -11044,6 +11044,7 @@ tests/webtbf/tw20721b.pp svneol=native#text/pascal
 tests/webtbf/tw20721c.pp svneol=native#text/pascal
 tests/webtbf/tw20907.pp svneol=native#text/plain
 tests/webtbf/tw20907a.pp svneol=native#text/plain
+tests/webtbf/tw21078.pp svneol=native#text/plain
 tests/webtbf/tw2128.pp svneol=native#text/plain
 tests/webtbf/tw2129.pp svneol=native#text/plain
 tests/webtbf/tw2154.pp svneol=native#text/plain
@@ -11922,6 +11923,7 @@ tests/webtbs/tw21029.pp svneol=native#text/plain
 tests/webtbs/tw21073.pp svneol=native#text/plain
 tests/webtbs/tw2109.pp svneol=native#text/plain
 tests/webtbs/tw2110.pp svneol=native#text/plain
+tests/webtbs/tw21151.pp svneol=native#text/plain
 tests/webtbs/tw21177.pp svneol=native#text/plain
 tests/webtbs/tw2128.pp svneol=native#text/plain
 tests/webtbs/tw2129.pp svneol=native#text/plain

+ 1 - 0
compiler/finput.pas

@@ -654,6 +654,7 @@ uses
            begin
              exefilename:=stringdup(p+OutputFileName);
              sharedlibfilename:=stringdup(p+OutputFileName);
+             n:=ChangeFileExt(OutputFileName,''); { for mapfilename and dbgfilename } 
            end
          else
            begin

+ 11 - 0
compiler/htypechk.pas

@@ -1313,6 +1313,17 @@ implementation
                          CGMessagePos(hp.fileinfo,parser_e_packed_element_no_var_addr);
                      exit;
                    end;
+                 { if we assign something to a field of a record that is not
+                   regable, then then the record can't be kept in a regvar,
+                   because we will force the record into memory for this
+                   subscript operation (to a temp location, so the assignment
+                   will happen to the temp and be lost) }
+                 if not gotsubscript and
+                    not gotderef and
+                    not gotvec and
+                    not tstoreddef(hp.resultdef).is_intregable then
+                   make_not_regable(hp,[ra_addr_regable]);
+
                  gotsubscript:=true;
                  { loop counter? }
                  if not(Valid_Const in opts) and

+ 3 - 2
compiler/i386/cpupara.pas

@@ -284,7 +284,7 @@ unit cpupara;
            size:=OS_INT;
            if calloption=pocall_register then
              begin
-               if (nr<=high(parasupregs)+1) then
+               if (nr<=length(parasupregs)) then
                  begin
                    if nr=0 then
                      internalerror(200309271);
@@ -295,7 +295,8 @@ unit cpupara;
                  begin
                    loc:=LOC_REFERENCE;
                    reference.index:=NR_STACK_POINTER_REG;
-                   reference.offset:=sizeof(aint)*nr;
+                   { the previous parameters didn't take up room in memory }
+                   reference.offset:=sizeof(aint)*(nr-length(parasupregs)-1)
                  end;
              end
            else

+ 5 - 2
compiler/msg/errore.msg

@@ -129,7 +129,7 @@ general_i_number_of_notes=01023_I_$1 note(s) issued
 #
 # Scanner
 #
-# 02087 is the last used one
+# 02089 is the last used one
 #
 % \section{Scanner messages.}
 % This section lists the messages that the scanner emits. The scanner takes
@@ -368,6 +368,9 @@ scanner_w_illegal_warn_identifier=02087_W_Illegal identifier "$1" for $WARN dire
 scanner_e_illegal_alignment_directive=02088_E_Illegal alignment directive
 % The alignment directive is not valid. Either the alignment type is not known or the alignment
 % value is not a power of two.
+scanner_f_illegal_utf8_bom=02089_F_It is not possible to include a file that starts with an UTF-8 BOM in a module that uses a different code page
+% All source code that is part of a single compilation entity (program, library, unit) must be encoded
+% in the same code page
 % \end{description}
 #
 # Parser
@@ -3376,7 +3379,7 @@ P*2WT_Specify MPW tool type application (Classic Mac OS)
 **2WX_Enable executable stack (Linux)
 **1X_Executable options:
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
-**2Xd_Do not use standard library search path (needed for cross compile)
+**2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
 **2Xe_Use external linker
 **2Xg_Create debuginfo in a separate file and add a debuglink section to executable
 **2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)

+ 3 - 2
compiler/msgidx.inc

@@ -108,6 +108,7 @@ const
   scan_w_multiple_main_name_overrides=02086;
   scanner_w_illegal_warn_identifier=02087;
   scanner_e_illegal_alignment_directive=02088;
+  scanner_f_illegal_utf8_bom=02089;
   parser_e_syntax_error=03000;
   parser_e_dont_nest_interrupt=03004;
   parser_w_proc_directive_ignored=03005;
@@ -900,9 +901,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 61685;
+  MsgTxtSize = 61832;
 
   MsgIdxMax : array[1..20] of longint=(
-    24,89,314,103,85,54,111,23,202,63,
+    24,90,314,103,85,54,111,23,202,63,
     51,20,1,1,1,1,1,1,1,1
   );

文件差異過大導致無法顯示
+ 457 - 456
compiler/msgtxt.inc


+ 1 - 1
compiler/ncon.pas

@@ -313,7 +313,7 @@ implementation
           constwstring :
             p1:=cstringconstnode.createwstr(pcompilerwidestring(p.value.valueptr));
           constreal :
-            p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,pbestrealtype^);
+            p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,p.constdef);
           constset :
             p1:=csetconstnode.create(pconstset(p.value.valueptr),p.constdef);
           constpointer :

+ 6 - 0
compiler/ninl.pas

@@ -3072,6 +3072,12 @@ implementation
          in_assert_x_y :
             begin
               expectloc:=LOC_VOID;
+{$ifdef i386}
+              { hack: on i386, the fourth parameter is passed via memory ->
+                we have to allocate enough stack space for it on targets that
+                use a fixed stack }
+              current_procinfo.allocate_push_parasize(4);
+{$endif}
             end;
 
           in_low_x,

+ 5 - 1
compiler/nld.pas

@@ -405,7 +405,11 @@ implementation
                      end;
                 end;
            labelsym :
-             ;
+             begin
+               if not assigned(tlabelsym(symtableentry).asmblocklabel) and
+                  not assigned(tlabelsym(symtableentry).code) then
+                 Message(parser_e_label_outside_proc);
+             end
            else
              internalerror(200104143);
          end;

+ 0 - 3
compiler/optdead.pas

@@ -312,9 +312,6 @@ const
         { make sure there's room for the name }
         if failiferror(fsymnamepos>length(line)) then
           exit;
-        { and that we're not in the middle of some other column }
-        if failiferror(pos(' ',copy(line,fsymnamepos,length(line)))>0) then
-          exit;
         result:=true;
       end;
 

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 134;
+  CurrentPPUVersion = 135;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 7 - 0
compiler/scanner.pas

@@ -2375,6 +2375,13 @@ In case not, the value returned can be arbitrary.
                      (ord((inputpointer+1)^)=$bb) and
                      (ord((inputpointer+2)^)=$bf) then
                      begin
+                       (* we don't support including files with an UTF-8 bom
+                          inside another file that wasn't encoded as UTF-8
+                          already (we don't support {$codepage xxx} switches in
+                          the middle of a file either) *)
+                       if (current_settings.sourcecodepage<>'utf8') and
+                          not current_module.in_global then
+                         Message(scanner_f_illegal_utf8_bom);
                        inc(inputpointer,3);
                        message(scan_c_switching_to_utf8);
                        current_settings.sourcecodepage:='utf8';

+ 7 - 3
compiler/symsym.pas

@@ -1729,6 +1729,7 @@ implementation
              end;
            constreal :
              begin
+               ppufile.getderef(constdefderef);
                new(pd);
                pd^:=ppufile.getreal;
                value.valueptr:=pd;
@@ -1773,14 +1774,14 @@ implementation
 
     procedure tconstsym.buildderef;
       begin
-        if consttyp in [constord,constpointer,constset] then
+        if consttyp in [constord,constreal,constpointer,constset] then
           constdefderef.build(constdef);
       end;
 
 
     procedure tconstsym.deref;
       begin
-        if consttyp in [constord,constpointer,constset] then
+        if consttyp in [constord,constreal,constpointer,constset] then
           constdef:=tdef(constdefderef.resolve);
       end;
 
@@ -1813,7 +1814,10 @@ implementation
                ppufile.putdata(pchar(value.valueptr)^,value.len);
              end;
            constreal :
-             ppufile.putreal(pbestreal(value.valueptr)^);
+             begin
+               ppufile.putderef(constdefderef);
+               ppufile.putreal(pbestreal(value.valueptr)^);
+             end;
            constset :
              begin
                ppufile.putderef(constdefderef);

+ 14 - 0
tests/webtbf/tw21078.pp

@@ -0,0 +1,14 @@
+{ %fail }
+
+{$goto on}
+label x;
+var p:pointer;
+
+procedure Foo();
+begin
+  x:
+end;
+
+begin
+	p:=@x;
+end.

+ 6 - 0
tests/webtbs/tw21151.pp

@@ -0,0 +1,6 @@
+const
+  cs = single(0.05);
+begin
+  if sizeof(cs)<>4 then
+    halt(1);
+end.

部分文件因文件數量過多而無法顯示