diff mbox series

[2/4] tcg: fix use of uninitialized variable under CONFIG_PROFILER

Message ID 20181010144853.13005-3-cota@braap.org
State New
Headers show
Series some TCG fixes | expand

Commit Message

Emilio Cota Oct. 10, 2018, 2:48 p.m. UTC
We forgot to initialize n in commit 15fa08f845 ("tcg: Dynamically
allocate TCGOps", 2017-12-29).

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 tcg/tcg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Oct. 10, 2018, 3:14 p.m. UTC | #1
On 10/10/2018 16:48, Emilio G. Cota wrote:
> We forgot to initialize n in commit 15fa08f845 ("tcg: Dynamically
> allocate TCGOps", 2017-12-29).
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  tcg/tcg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index f27b22bd3c..8f26916b99 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -3430,7 +3430,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
>  
>  #ifdef CONFIG_PROFILER
>      {
> -        int n;
> +        int n = 0;
>  
>          QTAILQ_FOREACH(op, &s->ops, link) {
>              n++;
>
diff mbox series

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index f27b22bd3c..8f26916b99 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3430,7 +3430,7 @@  int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
 
 #ifdef CONFIG_PROFILER
     {
-        int n;
+        int n = 0;
 
         QTAILQ_FOREACH(op, &s->ops, link) {
             n++;