From 841593d0136cfed3aabd77a871718b16a3d6137b Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 3 Feb 2016 21:39:41 -0800 Subject: [PATCH 1/3] Remove some compile warnings --- tgt-vvp/draw_ufunc.c | 4 +++- vvp/vthread.cc | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tgt-vvp/draw_ufunc.c b/tgt-vvp/draw_ufunc.c index 477ddfab8..7fe88abf2 100644 --- a/tgt-vvp/draw_ufunc.c +++ b/tgt-vvp/draw_ufunc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2005-2016 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -187,6 +187,7 @@ void draw_ufunc_vec4(ivl_expr_t expr) { ivl_scope_t def = ivl_expr_def(expr); ivl_signal_t retval = ivl_scope_port(def, 0); + (void) retval; /* Take in arguments to function and call function code. */ draw_ufunc_preamble(expr); @@ -198,6 +199,7 @@ void draw_ufunc_real(ivl_expr_t expr) { ivl_scope_t def = ivl_expr_def(expr); ivl_signal_t retval = ivl_scope_port(def, 0); + (void) retval; /* Take in arguments to function and call the function code. */ draw_ufunc_preamble(expr); diff --git a/vvp/vthread.cc b/vvp/vthread.cc index c341fc707..e99206198 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2016 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -4985,7 +4985,7 @@ bool of_RET_REAL(vthread_t thr, vvp_code_t cp) assert(fun_thr->parent); fun_thr = fun_thr->parent; } - assert(index >= 0 && index < fun_thr->args_real.size()); + assert(index < fun_thr->args_real.size()); unsigned depth = fun_thr->args_real[index]; // Use the depth to put the value into the stack of // the parent thread. @@ -5007,7 +5007,7 @@ bool of_RET_VEC4(vthread_t thr, vvp_code_t cp) assert(fun_thr->parent); fun_thr = fun_thr->parent; } - assert(index >= 0 && index < fun_thr->args_vec4.size()); + assert(index < fun_thr->args_vec4.size()); unsigned depth = fun_thr->args_vec4[index]; int off = off_index? thr->words[off_index].w_int : 0; @@ -5077,7 +5077,7 @@ bool of_RETLOAD_REAL(vthread_t thr, vvp_code_t cp) assert(fun_thr->parent); fun_thr = fun_thr->parent; } - assert(index >= 0 && index < fun_thr->args_real.size()); + assert(index < fun_thr->args_real.size()); unsigned depth = fun_thr->args_real[index]; // Use the depth to extract the values from the stack // of the parent thread. @@ -5097,7 +5097,7 @@ bool of_RETLOAD_VEC4(vthread_t thr, vvp_code_t cp) assert(fun_thr->parent); fun_thr = fun_thr->parent; } - assert(index >= 0 && index < fun_thr->args_vec4.size()); + assert(index < fun_thr->args_vec4.size()); unsigned depth = fun_thr->args_vec4[index]; // Use the depth to put the value into the stack of // the parent thread. From 3e52b2be66a4b26e4f017895364ce44ee5e51cde Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 3 Feb 2016 22:25:21 -0800 Subject: [PATCH 2/3] Fix valgrind compile --- vvp/codes.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vvp/codes.cc b/vvp/codes.cc index 7f08077f9..bb8bc8b27 100644 --- a/vvp/codes.cc +++ b/vvp/codes.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2016 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -113,7 +113,8 @@ void codespace_delete(void) count_opcodes -= 1; if ((cur+idx)->opcode == &of_VPI_CALL) { vpi_call_delete((cur+idx)->handle); - } else if ((cur+idx)->opcode == &of_EXEC_UFUNC) { + } else if (((cur+idx)->opcode == &of_EXEC_UFUNC_REAL) || + ((cur+idx)->opcode == &of_EXEC_UFUNC_VEC4)) { exec_ufunc_delete((cur+idx)); } else if ((cur+idx)->opcode == &of_FILE_LINE) { delete((cur+idx)->handle); From eef3e8c09f85f5bb83608aff2a60868108d94909 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 4 Feb 2016 07:20:06 -0800 Subject: [PATCH 3/3] Fix memory leak in time suffix code (VHDL) --- vpi/sys_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 28031a73f..a28575436 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2016 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -650,6 +650,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus, * It is needed by vhdlpp to correctly implement time'image(). */ PLI_INT32 time_prec = vpi_get(vpiTimePrecision, info->scope); + free(timeformat_info.suff); if(time_units < -12) timeformat_info.suff = strdup(" fs"); else if(time_units < -9)