Put code where it belongs.

This commit is contained in:
Olaf Seibert
2015-05-09 23:54:54 +02:00
parent 787625ab47
commit 32b8059cf8
2 changed files with 9 additions and 9 deletions

View File

@@ -693,8 +693,15 @@ void write_globals(
SYMBOL_ITER sym_iter;
int isect;
if (obj == NULL)
return; /* Nothing to do if no OBJ file. */
if (obj == NULL) {
for (isect = 0; isect < sector; isect++) {
psect = sections[isect];
psect->sector = isect; /* Assign it a sector */
psect->pc = 0; /* Reset its PC for second pass */
}
return; /* Nothing more to do if no OBJ file. */
}
gsd_init(&gsd, obj);

View File

@@ -353,13 +353,6 @@ int main(
stack_push(&stack, str);
}
/*
* Reset dot in all sections. write_globals() only does it
* if there is an object file.
*/
for (i = 0; i < sector; i++) {
sections[i]->pc = 0;
}
DOT = 0;
current_pc->section = &blank_section;