* better error recovering in typed constants

* some problems with arrays of const fixed, some problems
    due my previous
     - the location type of array constructor is now LOC_MEM
     - the pushing of high fixed
     - parameter copying fixed
     - zero temp. allocation removed
  * small problem in the assembler writers fixed:
    ref to nil wasn't written correctly
This commit is contained in:
florian 1999-05-23 18:41:55 +00:00
parent f664777328
commit 6b33f4d87d
17 changed files with 7284 additions and 7073 deletions

View File

@ -189,12 +189,18 @@ unit ag386int;
getopstr:=tostr(o.val);
top_symbol :
begin
hs:='offset '+o.sym^.name;
if assigned(o.sym) then
hs:='offset '+o.sym^.name
else
hs:='offset ';
if o.symofs>0 then
hs:=hs+'+'+tostr(o.symofs)
else
if o.symofs<0 then
hs:=hs+tostr(o.symofs);
hs:=hs+tostr(o.symofs)
else
if not(assigned(o.sym)) then
hs:=hs+'0';
getopstr:=hs;
end;
top_ref :
@ -795,7 +801,18 @@ ait_stab_function_name : ;
end.
{
$Log$
Revision 1.42 1999-05-21 13:54:42 peter
Revision 1.43 1999-05-23 18:41:55 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.42 1999/05/21 13:54:42 peter
* NEWLAB for label as symbol
Revision 1.41 1999/05/12 00:19:38 peter

View File

@ -191,12 +191,18 @@ unit ag386nsm;
getopstr:=tostr(o.val);
top_symbol :
begin
hs:='dword '+o.sym^.name;
if assigned(o.sym) then
hs:='dword '+o.sym^.name
else
hs:='dword ';
if o.symofs>0 then
hs:=hs+'+'+tostr(o.symofs)
else
if o.symofs<0 then
hs:=hs+tostr(o.symofs);
hs:=hs+tostr(o.symofs)
else
if not(assigned(o.sym)) then
hs:=hs+'0';
getopstr:=hs;
end;
top_ref :
@ -760,7 +766,18 @@ ait_stab_function_name : ;
end.
{
$Log$
Revision 1.38 1999-05-21 13:54:43 peter
Revision 1.39 1999-05-23 18:41:57 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.38 1999/05/21 13:54:43 peter
* NEWLAB for label as symbol
Revision 1.37 1999/05/12 00:19:39 peter

View File

@ -1190,7 +1190,18 @@ implementation
end.
{
$Log$
Revision 1.85 1999-05-21 13:54:44 peter
Revision 1.86 1999-05-23 18:41:58 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.85 1999/05/21 13:54:44 peter
* NEWLAB for label as symbol
Revision 1.84 1999/05/18 22:34:26 pierre

View File

@ -1240,7 +1240,18 @@ implementation
end.
{
$Log$
Revision 1.52 1999-05-21 13:54:50 peter
Revision 1.53 1999-05-23 18:42:01 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.52 1999/05/21 13:54:50 peter
* NEWLAB for label as symbol
Revision 1.51 1999/05/18 21:58:27 florian

View File

@ -237,6 +237,7 @@ implementation
is always an reference! }
if (pvarsym(p^.symtableentry)^.varspez=vs_var) or
is_open_array(pvarsym(p^.symtableentry)^.definition) or
is_array_of_const(pvarsym(p^.symtableentry)^.definition) or
((pvarsym(p^.symtableentry)^.varspez=vs_const) and
push_addr_param(pvarsym(p^.symtableentry)^.definition)) then
begin
@ -781,6 +782,10 @@ implementation
if not p^.cargs then
begin
reset_reference(p^.location.reference);
if parraydef(p^.resulttype)^.highrange=-1 then
begin
end
else
gettempofsizereference((parraydef(p^.resulttype)^.highrange+1)*8,p^.location.reference);
href:=p^.location.reference;
end;
@ -871,7 +876,18 @@ implementation
end.
{
$Log$
Revision 1.57 1999-05-21 13:54:51 peter
Revision 1.58 1999-05-23 18:42:02 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.57 1999/05/21 13:54:51 peter
* NEWLAB for label as symbol
Revision 1.56 1999/05/17 23:51:38 peter

View File

@ -501,7 +501,8 @@ implementation
{ offset can only differ from 0 if arraydef }
if (p^.left^.resulttype^.deftype=arraydef) then
begin
if not(is_open_array(p^.left^.resulttype)) then
if not(is_open_array(p^.left^.resulttype)) and
not(is_array_of_const(p^.left^.resulttype)) then
begin
if (p^.right^.value>parraydef(p^.left^.resulttype)^.highrange) or
(p^.right^.value<parraydef(p^.left^.resulttype)^.lowrange) then
@ -856,7 +857,18 @@ implementation
end.
{
$Log$
Revision 1.44 1999-05-21 13:54:53 peter
Revision 1.45 1999-05-23 18:42:04 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.44 1999/05/21 13:54:53 peter
* NEWLAB for label as symbol
Revision 1.43 1999/05/19 16:48:21 florian

View File

@ -589,7 +589,7 @@ const msgtxt : array[0..000095,1..240] of char=(
'3*2Anasmcoff_coff file using Nasm'#000+
'3*2Anasmelf_elf32 (Linux) file using Nasm'#000+
'3*2Anasmobj_ob','j file using Nasm'#000+
'3*2Amasm_obj file using Masm (Mircosoft)'#000+
'3*2Amasm_obj file using Masm (Microsoft)'#000+
'3*2Atasm_obj file using Tasm (Borland)'#000+
'3*1R<x>_assembler reading style:'#000+
'3*2Ratt_read AT&T style assembler'#000+

View File

@ -714,6 +714,14 @@ unit ptconst;
consume(RKLAMMER);
end;
end;
errordef:
begin
{ try to consume something useful }
if token=LKLAMMER then
consume_all_until(RKLAMMER)
else
consume_all_until(SEMICOLON);
end;
else Message(parser_e_type_const_not_possible);
end;
end;
@ -721,7 +729,18 @@ unit ptconst;
end.
{
$Log$
Revision 1.44 1999-05-21 13:55:11 peter
Revision 1.45 1999-05-23 18:42:13 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.44 1999/05/21 13:55:11 peter
* NEWLAB for label as symbol
Revision 1.43 1999/05/12 00:19:54 peter

View File

@ -3499,9 +3499,26 @@ Const local_symtable_index : longint = $8001;
end;
{$endif GDB}
function terrordef.gettypename:string;
begin
gettypename:='<erroneous type>';
end;
{
$Log$
Revision 1.121 1999-05-21 13:55:19 peter
Revision 1.122 1999-05-23 18:42:14 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.121 1999/05/21 13:55:19 peter
* NEWLAB for label as symbol
Revision 1.120 1999/05/20 22:22:43 pierre

View File

@ -142,6 +142,7 @@
{$ifdef GDB}
function stabstring : pchar;virtual;
{$endif GDB}
function gettypename:string;virtual;
end;
{ tpointerdef and tclassrefdef should get a common
@ -516,7 +517,18 @@
{
$Log$
Revision 1.28 1999-05-19 16:48:28 florian
Revision 1.29 1999-05-23 18:42:15 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.28 1999/05/19 16:48:28 florian
* tdef.typename: returns a now a proper type name for the most types
Revision 1.27 1999/05/13 21:59:42 peter

View File

@ -284,7 +284,7 @@ unit symtable;
s32bitdef : porddef; { Pointer to 32-Bit signed }
cu64bitdef : porddef; { pointer to 64 bit unsigned def }
cs64bitdef : porddef; { pointer to 64 bit signed def, }
cs64bitintdef : porddef; { pointer to 64 bit signed def, }
{ calculated by the int unit on i386 }
s32floatdef : pfloatdef; { pointer for realconstn }
@ -2345,7 +2345,18 @@ const localsymtablestack : psymtable = nil;
end.
{
$Log$
Revision 1.15 1999-05-17 23:51:41 peter
Revision 1.16 1999-05-23 18:42:16 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.15 1999/05/17 23:51:41 peter
* with temp vars now use a reference with a persistant temp instead
of setting datasize

View File

@ -481,12 +481,12 @@ implementation
begin
if (porddef(ld)^.typ<>s64bitint) then
begin
p^.left:=gentypeconvnode(p^.left,cs64bitdef);
p^.left:=gentypeconvnode(p^.left,cs64bitintdef);
firstpass(p^.left);
end;
if (porddef(rd)^.typ<>s64bitint) then
begin
p^.right:=gentypeconvnode(p^.right,cs64bitdef);
p^.right:=gentypeconvnode(p^.right,cs64bitintdef);
firstpass(p^.right);
end;
calcregisters(p,2,0,0);
@ -1097,7 +1097,18 @@ implementation
end.
{
$Log$
Revision 1.31 1999-05-19 20:40:14 florian
Revision 1.32 1999-05-23 18:42:18 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.31 1999/05/19 20:40:14 florian
* fixed a couple of array related bugs:
- var a : array[0..1] of char; p : pchar; p:=a+123; works now
- open arrays with an odd size doesn't work: movsb wasn't generated

View File

@ -69,7 +69,8 @@ implementation
case p^.left^.resulttype^.deftype of
arraydef :
begin
if is_open_array(p^.left^.resulttype) then
if is_open_array(p^.left^.resulttype) or
is_array_of_const(p^.left^.resulttype) then
begin
st:=p^.left^.symtable;
getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
@ -1166,7 +1167,18 @@ implementation
end.
{
$Log$
Revision 1.46 1999-05-20 14:58:27 peter
Revision 1.47 1999-05-23 18:42:19 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.46 1999/05/20 14:58:27 peter
* fixed arrayconstruct->set conversion which didn't work for enum sets
Revision 1.45 1999/05/19 10:31:54 florian

View File

@ -1011,7 +1011,8 @@ implementation
end
else
begin
if is_open_array(p^.left^.resulttype) then
if is_open_array(p^.left^.resulttype) or
is_array_of_const(p^.left^.resulttype) then
begin
getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
@ -1104,7 +1105,18 @@ implementation
end.
{
$Log$
Revision 1.33 1999-05-06 09:05:35 peter
Revision 1.34 1999-05-23 18:42:20 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.33 1999/05/06 09:05:35 peter
* generic write_float and str_float
* fixed constant float conversions

View File

@ -439,7 +439,7 @@ implementation
parraydef(p^.resulttype)^.definition:=pd;
parraydef(p^.resulttype)^.IsConstructor:=true;
parraydef(p^.resulttype)^.IsVariant:=varia;
p^.location.loc:=LOC_REFERENCE;
p^.location.loc:=LOC_MEM;
end;
@ -457,7 +457,18 @@ implementation
end.
{
$Log$
Revision 1.31 1999-05-19 15:26:41 florian
Revision 1.32 1999-05-23 18:42:22 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.31 1999/05/19 15:26:41 florian
* if a non local variables isn't initialized the compiler doesn't write
any longer "local var. seems not to be ..."

View File

@ -446,7 +446,8 @@ implementation
function push_high_param(def : pdef) : boolean;
begin
push_high_param:=is_open_array(def) or is_open_string(def);
push_high_param:=is_open_array(def) or is_open_string(def) or
is_array_of_const(def);
end;
@ -884,7 +885,18 @@ implementation
end.
{
$Log$
Revision 1.64 1999-05-19 20:55:08 florian
Revision 1.65 1999-05-23 18:42:23 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.64 1999/05/19 20:55:08 florian
* fix of my previous commit
Revision 1.63 1999/05/19 20:40:15 florian

View File

@ -13,7 +13,6 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
program msg2inc;
program nasmconv;
var
@ -295,7 +294,18 @@ begin
end.
{
$Log$
Revision 1.1 1999-05-12 16:17:10 peter
Revision 1.2 1999-05-23 18:42:24 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.1 1999/05/12 16:17:10 peter
* init
Revision 1.1 1999/05/12 16:08:27 peter