From efd86e5b0f756b04675e2ef7e26a64508300d9a8 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 5 Apr 2021 10:58:56 -0400 Subject: sim: m32c: opc2c: remove unused vlist variable When building with AddressSanitizer, sim/m32c fails with: ./opc2c -l r8c.out /home/simark/src/binutils-gdb/sim/m32c/r8c.opc > r8c.c sim_log: r8c.out ================================================================= ==3919390==ERROR: LeakSanitizer: detected memory leaks Direct leak of 4 byte(s) in 1 object(s) allocated from: #0 0x7ffff7677459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55555555b3df in main /home/simark/src/binutils-gdb/sim/m32c/opc2c.c:658 #2 0x7ffff741fb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) Fix the leak in main by removing the vlist variable, which seems unused. --- sim/m32c/ChangeLog | 4 ++++ sim/m32c/opc2c.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'sim') diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog index cf5545c..31e3523 100644 --- a/sim/m32c/ChangeLog +++ b/sim/m32c/ChangeLog @@ -1,3 +1,7 @@ +2021-04-07 Simon Marchi + + * opc2c.c (main): Remove vlist variable. + 2021-04-02 Mike Frysinger * aclocal.m4, configure: Regenerate. diff --git a/sim/m32c/opc2c.c b/sim/m32c/opc2c.c index 082d4e9..3d8f2c1 100644 --- a/sim/m32c/opc2c.c +++ b/sim/m32c/opc2c.c @@ -507,7 +507,6 @@ main (int argc, char **argv) FILE *in; int lineno = 0; int i; - VaryRef *vlist; if (argc > 2 && strcmp (argv[1], "-l") == 0) { @@ -655,8 +654,6 @@ main (int argc, char **argv) qsort (opcodes, n_opcodes, sizeof (opcodes[0]), op_cmp); - vlist = (VaryRef *) malloc (n_varies * sizeof (VaryRef)); - for (i = 0; i < n_opcodes; i++) { int j, b, v; -- cgit v1.1