aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2020-10-05 00:09:18 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2020-10-05 00:09:18 +0300
commit5e587fda09597b6b697b7d5799562dcc6ca2e4f7 (patch)
treed6581df58a5cdd239dfdf3b2c339d25ef93447a3
parent78f14ab1a63963fd302ce7ecc48b6a9df5442675 (diff)
downloadnasm-5e587fda09597b6b697b7d5799562dcc6ca2e4f7.tar.gz
nasm-5e587fda09597b6b697b7d5799562dcc6ca2e4f7.tar.xz
nasm-5e587fda09597b6b697b7d5799562dcc6ca2e4f7.zip
preproc: use explicit addressing while clearing smacro
Better point out explicitly that SMacro::next member is untouched, thus do not use SMacro::next and an array. CID 1432925 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--asm/preproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/asm/preproc.c b/asm/preproc.c
index 629fe5df..69543174 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -979,7 +979,7 @@ static void clear_smacro(SMacro *s)
{
free_smacro_members(s);
/* Wipe everything except the next pointer */
- memset(&s->next + 1, 0, sizeof *s - sizeof s->next);
+ memset(&s->name, 0, sizeof(*s) - offsetof(SMacro, name));
}
/*