mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 22:29:24 +02:00
* fixed misplaced bracket in condition test that caused all blocks
in libraries to be parsed as if they were the main module block, which in practice mainly mean that local variables with default values were never initialisation (mantis #16949) git-svn-id: trunk@15596 -
This commit is contained in:
parent
9affb070b8
commit
5b0962b735
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -10544,6 +10544,8 @@ tests/webtbs/tw16861.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16863.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16874.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16901.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16949a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16949b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1696.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1699.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1709.pp svneol=native#text/plain
|
||||
|
@ -186,9 +186,8 @@ implementation
|
||||
if (
|
||||
assigned(current_procinfo.procdef.localst) and
|
||||
(current_procinfo.procdef.localst.symtablelevel=main_program_level) and
|
||||
(current_module.is_unit)
|
||||
) or
|
||||
islibrary then
|
||||
(current_module.is_unit or islibrary)
|
||||
) then
|
||||
begin
|
||||
if (token=_END) then
|
||||
begin
|
||||
|
19
tests/webtbs/tw16949a.pp
Normal file
19
tests/webtbs/tw16949a.pp
Normal file
@ -0,0 +1,19 @@
|
||||
{ %norun }
|
||||
{ %target=win32,win64,wince,darwin,linux,freebsd,solaris,beos}
|
||||
|
||||
library tw16949a;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
function foo: LongInt; cdecl;
|
||||
var
|
||||
x: LongInt = 12345;
|
||||
begin
|
||||
Result := x;
|
||||
end;
|
||||
|
||||
exports
|
||||
foo;
|
||||
|
||||
begin
|
||||
end.
|
21
tests/webtbs/tw16949b.pp
Normal file
21
tests/webtbs/tw16949b.pp
Normal file
@ -0,0 +1,21 @@
|
||||
{ %target=win32,win64,wince,darwin,linux,freebsd,solaris,beos}
|
||||
{ %needlibrary }
|
||||
|
||||
program ptest;
|
||||
|
||||
{$ifdef fpc}{$mode objfpc}{$H+}{$endif fpc}
|
||||
|
||||
const
|
||||
{$if defined(windows) or defined(mswindows)}
|
||||
libname='tw16949a.dll';
|
||||
{$else}
|
||||
libname='tw16949a';
|
||||
{$linklib tw16949a}
|
||||
{$ifend}
|
||||
|
||||
function foo: LongInt; cdecl; external libname;
|
||||
|
||||
begin
|
||||
if foo<>12345 then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user