summaryrefslogtreecommitdiff
path: root/output/outmacho.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2018-06-18 17:11:54 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2018-06-18 17:11:54 -0700
commit2c57d0a5ca2d7a8982f3e6591e12c45e6fd35717 (patch)
treefe1c433512d564bd23369519983a699bc2826c57 /output/outmacho.c
parenta5992a4c41784aafe6741b78a71288550bbbdc21 (diff)
downloadnasm-2c57d0a5ca2d7a8982f3e6591e12c45e6fd35717.tar.gz
RAA: make pointer vs integer RAAs type safe
Use pseudo-types to make it impossible to confuse RAAs made of integers and RAAs made of pointers. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'output/outmacho.c')
-rw-r--r--output/outmacho.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index e540b7d8..75650b47 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -313,7 +313,7 @@ static uint64_t rel_padcnt = 0;
ALIGN(x, fmt.ptrsize) /* align x to output format width */
static struct hash_table section_by_name;
-static struct RAA *section_by_index;
+static struct RAAPTR *section_by_index;
static struct section * never_null
find_or_add_section(const char *segname, const char *sectname)
@@ -436,7 +436,7 @@ static void macho_init(void)
extsyms = raa_init();
strs = saa_init(1L);
- section_by_index = raa_init();
+ section_by_index = raa_init_ptr();
hash_init(&section_by_name, HASH_MEDIUM);
/* string table starts with a zero byte so index 0 is an empty string */
@@ -1808,7 +1808,7 @@ static void macho_cleanup(void)
nasm_free(extdefsyms);
nasm_free(undefsyms);
nasm_free(sectstab);
- raa_free(section_by_index);
+ raa_free_ptr(section_by_index);
hash_free(&section_by_name);
}