2018-01-19
2018-01-19 16:14:39 by Martin Nilsson <nilsson@fastmail.com>
-
78488ca7ee8aeb7b334cd636e204e862669902b8
(8 lines)
(+4/-4)
[
Show
| Annotate
]
Branch: master
Initialize scope_info with calloc.
2483:
struct scope_info *externals; /* External scopes. scope_id == program_id */
};
- #define VAR_BLOCKED 0
- #define VAR_UNUSED 1
+ #define VAR_UNUSED 0 /* Rely on unused being 0 for calloc call. */
+ #define VAR_BLOCKED 1
#define VAR_USED 3
/* FIXME: Shouldn't the following two functions be named "*_or_vars"? */
2621: Inside #if defined(PIKE_DEBUG)
fputs("Creating new scope.\n", stderr);
}
#endif /* PIKE_DEBUG */
- new = (struct scope_info *)xalloc(sizeof(struct scope_info));
- memset(new, VAR_UNUSED, sizeof(struct scope_info));
+ new = (struct scope_info *)xcalloc(1, sizeof(struct scope_info));
new->next = *a;
new->scope_id = scope_id;
*a = new;