diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-04-01 13:19:07 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-21 17:27:45 +0200 |
commit | 06c0531322a54e532eb3b9155bbf9f51adca0492 (patch) | |
tree | 9e0084b6ef92104f3351d2c0bf6155a4c146e0ba | |
parent | 38e7c70c3074caab4c5aa68c0cee299a71537bee (diff) | |
download | sparse-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.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -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; |