From 33eb3f241810e3cbab6ed2331a5f96a79a3754ff Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 14 Nov 2012 13:25:30 +0900 Subject: [PATCH] A bit of pointer saftey in add_defs. Directly accessing odef after can be dangerous (probably not here, but hey), so use the defref instead. --- tools/qfcc/source/linker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/linker.c b/tools/qfcc/source/linker.c index ff6aec959..267ebbf32 100644 --- a/tools/qfcc/source/linker.c +++ b/tools/qfcc/source/linker.c @@ -479,8 +479,9 @@ add_defs (qfo_t *qfo, qfo_mspace_t *space, qfo_mspace_t *dest_space, ref = get_defref (odef, dest_space); work_defrefs[num_work_defrefs++] = ref; process (ref, dest_space, idef); - odef->relocs = add_relocs (qfo, odef->relocs, odef->num_relocs, - odef - dest_space->defs); + REF (ref)->relocs = add_relocs (qfo, REF (ref)->relocs, + REF (ref)->num_relocs, + REF (ref) - dest_space->defs); } dest_space->num_defs += count; return count;