aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-04-01 13:19:07 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-05-21 17:27:45 +0200
commit06c0531322a54e532eb3b9155bbf9f51adca0492 (patch)
tree9e0084b6ef92104f3351d2c0bf6155a4c146e0ba
parent38e7c70c3074caab4c5aa68c0cee299a71537bee (diff)
downloadsparse-06c0531322a54e532eb3b9155bbf9f51adca0492.tar.gz
scope: no memset() needed after __alloc_scope()
When starting some scopes, the newly allocated struct is memset'ed with zero but this is unneeded since the allocator always returns zeroed memory. Remove the unneeded call to memset(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--scope.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 420c0f5a..0e4fb3b4 100644
--- a/scope.c
+++ b/scope.c
@@ -68,7 +68,6 @@ void rebind_scope(struct symbol *sym, struct scope *new)
static void start_scope(struct scope **s)
{
struct scope *scope = __alloc_scope(0);
- memset(scope, 0, sizeof(*scope));
scope->next = *s;
*s = scope;
}
@@ -77,7 +76,6 @@ void start_file_scope(void)
{
struct scope *scope = __alloc_scope(0);
- memset(scope, 0, sizeof(*scope));
scope->next = &builtin_scope;
file_scope = scope;