harec

[hare] Hare compiler, written in C11 for POSIX OSs
Log | Files | Refs | README | LICENSE

commit c4bf0ccb9d603206ba20c88d5ae7477bb425c253
parent 12393e2c946a002b7482c34bb37c45adcfdc19f4
Author: Bor Grošelj Simić <bgs@turminal.net>
Date:   Sun, 29 May 2022 01:20:06 +0200

zero out ns when duplicating unqualified identifier

Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>

Diffstat:
Msrc/identifier.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/identifier.c b/src/identifier.c @@ -117,6 +117,8 @@ identifier_dup(struct identifier *new, const struct identifier *ident) if (ident->ns) { new->ns = xcalloc(1, sizeof(struct identifier)); identifier_dup(new->ns, ident->ns); + } else { + new->ns = NULL; } }