Use collections in the object file structure instead of managing the items

manually.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4773 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-07-30 20:58:51 +00:00
parent 5bffbc98ff
commit f308a3c4d1
11 changed files with 135 additions and 124 deletions

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<EFBFBD>merstra<EFBFBD>e 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 1998-2010, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -276,15 +276,16 @@ Section* ReadSection (FILE* F, ObjData* O)
LineInfoIndex = ReadVar (F);
if (LineInfoIndex) {
--LineInfoIndex;
if (LineInfoIndex >= O->LineInfoCount) {
if (LineInfoIndex >= CollCount (&O->LineInfos)) {
Internal ("In module `%s', file `%s', line %lu: Invalid line "
"info with index %u (max count %u)",
GetObjFileName (O),
GetSourceFileName (O, Frag->Pos.Name),
Frag->Pos.Line, LineInfoIndex, O->LineInfoCount);
Frag->Pos.Line, LineInfoIndex,
CollCount (&O->LineInfos));
}
/* Point from the fragment to the line info... */
Frag->LI = O->LineInfos[LineInfoIndex];
Frag->LI = CollAt (&O->LineInfos, LineInfoIndex);
/* ...and back from the line info to the fragment */
CollAppend (&Frag->LI->Fragments, Frag);
}