From 97212e87bdcd9f9cff54aa979a48ce73535a0e88 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 19 Jun 2020 16:22:31 +0200 Subject: [PATCH] Fix zeroing of literal pool entries * lightening/lightening.c (reset_literal_pool): Zero before setting size to 0. Thanks to Dale Smith for pointing this out! --- lightening/lightening.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightening/lightening.c b/lightening/lightening.c index ca5708f0a..62f1e9d37 100644 --- a/lightening/lightening.c +++ b/lightening/lightening.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2019 Free Software Foundation, Inc. + * Copyright (C) 2012-2020 Free Software Foundation, Inc. * * This file is part of GNU lightning. * @@ -1238,8 +1238,8 @@ static void reset_literal_pool(jit_state_t *_jit, struct jit_literal_pool *pool) { pool->deadline = _jit->limit - _jit->start; - pool->size = 0; memset(pool->entries, 0, sizeof(pool->entries[0]) * pool->size); + pool->size = 0; } #define INITIAL_LITERAL_POOL_CAPACITY 12