Merged revisions 1455 via svnmerge from

http://peter@svn.freepascal.org/svn/fpc/trunk

r1455 (peter)
  * check for allowed floatdef operations

git-svn-id: branches/fixes_2_0@1498 -
This commit is contained in:
peter 2005-10-19 08:16:12 +00:00
parent 8375c114e5
commit 0234ecba9c
3 changed files with 27 additions and 3 deletions

1
.gitattributes vendored
View File

@ -5377,6 +5377,7 @@ tests/webtbf/tw4153.pp svneol=native#text/plain
tests/webtbf/tw4227.pp svneol=native#text/plain
tests/webtbf/tw4244.pp svneol=native#text/plain
tests/webtbf/tw4256.pp svneol=native#text/plain
tests/webtbf/tw4445.pp svneol=native#text/plain
tests/webtbf/uw0744.pp svneol=native#text/plain
tests/webtbf/uw0840a.pp svneol=native#text/plain
tests/webtbf/uw0840b.pp svneol=native#text/plain

View File

@ -1021,7 +1021,8 @@ implementation
{ if both are floatdefs, conversion is already done before constant folding }
else if (ld.deftype=floatdef) then
begin
{ already converted }
if not(nodetype in [addn,subn,muln,slashn,equaln,unequaln,ltn,lten,gtn,gten]) then
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
end
{ left side a setdef, must be before string processing,
@ -1783,8 +1784,6 @@ implementation
function taddnode.first_addfloat: tnode;
var
procname: string[31];
temp: tnode;
power: longint;
{ do we need to reverse the result ? }
notnode : boolean;
begin

24
tests/webtbf/tw4445.pp Executable file
View File

@ -0,0 +1,24 @@
{ %fail }
{ Source provided for Free Pascal Bug Report 4445 }
{ Submitted by "lito steel" on 2005-10-17 }
{ e-mail: litosteel@yahoo.com }
{ those are the definitions }
const
StackMax = 10;
var
Stack:array[1..StackMax] of double;
StackTop: integer = 0;
{in this procedure the compiler complains}
procedure aAND;
var a: double;
begin
a := Stack[StackTop];
dec(StackTop);
Stack[StackTop] := Stack[StackTop] and a;
end;
begin
aand;
end.