Browse Source

* update init_settings.setalloc in SetCompileMode if changeinit is set

git-svn-id: trunk@23898 -
florian 12 years ago
parent
commit
d4613fe961
3 changed files with 16 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 6 2
      compiler/scanner.pas
  3. 9 0
      tests/tbs/tbs0594.pp

+ 1 - 0
.gitattributes

@@ -9837,6 +9837,7 @@ tests/tbs/tb0591.pp svneol=native#text/pascal
 tests/tbs/tb0592.pp svneol=native#text/plain
 tests/tbs/tb0593.pp svneol=native#text/pascal
 tests/tbs/tb205.pp svneol=native#text/plain
+tests/tbs/tbs0594.pp svneol=native#text/pascal
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 6 - 2
compiler/scanner.pas

@@ -504,7 +504,10 @@ implementation
            else
              current_settings.packenum:=4;
            if changeinit then
-             init_settings.packenum:=current_settings.packenum;
+             begin
+               init_settings.packenum:=current_settings.packenum;
+               init_settings.setalloc:=current_settings.setalloc;
+             end;
 {$ifdef i386}
            { Default to intel assembler for delphi/tp7 on i386 }
            if (m_delphi in current_settings.modeswitches) or
@@ -1909,7 +1912,7 @@ In case not, the value returned can be arbitrary.
 
            { try to find the file }
            found:=findincludefile(path,name,foundfile);
-           if (ExtractFileExt(name)='') then
+           if (not found) and (ExtractFileExt(name)='') then
             begin
               { try default extensions .inc , .pp and .pas }
               if (not found) then
@@ -1928,6 +1931,7 @@ In case not, the value returned can be arbitrary.
                current_scanner.tempcloseinputfile;
                { load new file }
                hp:=do_openinputfile(foundfile);
+               hp.inc_path:=path;
                current_scanner.addfile(hp);
                current_module.sourcefiles.register_file(hp);
                if (not found) then

+ 9 - 0
tests/tbs/tbs0594.pp

@@ -0,0 +1,9 @@
+{ %opt=-Sd }
+var
+  s : set of 0..7;
+begin
+  if sizeof(s)<>1 then
+    halt(1);
+  writeln('ok');
+end.
+