aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-07-06 19:40:02 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-07-06 19:40:02 +0400
commit4cc10643282ac0879e85352c33b87b2db1e526b3 (patch)
tree4a93ac449975c917e7b5826247740f51a4d095bf
parentfaf23d1302cd74ad961cf5b1c7311841e9f50b28 (diff)
downloadnasm-test-4cc10643282ac0879e85352c33b87b2db1e526b3.tar.gz
nasm-test-4cc10643282ac0879e85352c33b87b2db1e526b3.tar.xz
nasm-test-4cc10643282ac0879e85352c33b87b2db1e526b3.zip
outbin: Cleanup bin_cleanup
No need for 'q' variable. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--output/outbin.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/output/outbin.c b/output/outbin.c
index 6a90aa0d..4012cc9c 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -538,15 +538,17 @@ static void bin_cleanup(int debuginfo)
saa_rewind(s->contents);
/* Apply relocations. */
list_for_each(r, relocs) {
- uint8_t *p, *q, mydata[8];
+ uint8_t *p, mydata[8];
int64_t l;
- int b;
+ int b;
+
+ nasm_assert(r->bytes <= 8);
saa_fread(r->target->contents, r->posn, mydata, r->bytes);
- p = q = mydata;
+ p = mydata;
l = 0;
for (b = r->bytes - 1; b >= 0; b--)
- l = (l << 8) + p[b];
+ l = (l << 8) + mydata[b];
s = find_section_by_index(r->secref);
if (s) {
@@ -563,7 +565,7 @@ static void bin_cleanup(int debuginfo)
l -= s->vstart;
}
- WRITEADDR(q, l, r->bytes);
+ WRITEADDR(p, l, r->bytes);
saa_fwrite(r->target->contents, r->posn, mydata, r->bytes);
}