diff --git a/vvp/array.cc b/vvp/array.cc index 21b396c8c..26bf2d6ff 100644 --- a/vvp/array.cc +++ b/vvp/array.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2007-2013 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 @@ -914,6 +914,11 @@ static int vpi_array_vthr_APV_get(int code, vpiHandle ref) case vpiAutomatic: return (int) parent->scope->is_automatic; +#ifdef CHECK_WITH_VALGRIND + case _vpiFromThr: + return _vpi_at_APV; +#endif + case vpiConstantSelect: return 1; @@ -1946,4 +1951,10 @@ void A_delete(vpiHandle item) delete obj; } + +void APV_delete(vpiHandle item) +{ + struct __vpiArrayVthrAPV*obj = (struct __vpiArrayVthrAPV*) item; + delete obj; +} #endif diff --git a/vvp/vpi_priv.h b/vvp/vpi_priv.h index e21984b38..62245ecc7 100644 --- a/vvp/vpi_priv.h +++ b/vvp/vpi_priv.h @@ -1,7 +1,7 @@ #ifndef __vpi_priv_H #define __vpi_priv_H /* - * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2013 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 @@ -59,12 +59,13 @@ extern vpiHandle vpip_build_file_line(char*description, */ #ifdef CHECK_WITH_VALGRIND #define _vpiFromThr 0x1000001 -# define _vpiNoThr 0 -# define _vpiString 1 -# define _vpiVThr 2 -# define _vpiWord 3 -# define _vpi_at_PV 4 -# define _vpi_at_A 5 +# define _vpiNoThr 0 +# define _vpiString 1 +# define _vpiVThr 2 +# define _vpiWord 3 +# define _vpi_at_PV 4 +# define _vpi_at_A 5 +# define _vpi_at_APV 6 #endif diff --git a/vvp/vpi_tasks.cc b/vvp/vpi_tasks.cc index 06617b965..d20951ce6 100644 --- a/vvp/vpi_tasks.cc +++ b/vvp/vpi_tasks.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2013 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 @@ -857,8 +857,13 @@ void vpi_call_delete(vpiHandle item) } break; case vpiMemoryWord: - if (vpi_get(_vpiFromThr, obj->args[arg]) == _vpi_at_A) { + switch (vpi_get(_vpiFromThr, obj->args[arg])) { + case _vpi_at_A: A_delete(obj->args[arg]); + break; + case _vpi_at_APV: + APV_delete(obj->args[arg]); + break; } break; case vpiPartSelect: diff --git a/vvp/vvp_cleanup.h b/vvp/vvp_cleanup.h index 66ddc57ae..7f4237643 100644 --- a/vvp/vvp_cleanup.h +++ b/vvp/vvp_cleanup.h @@ -1,7 +1,7 @@ #ifndef __vvp_cleanup_H #define __vvp_cleanup_H /* - * Copyright (c) 2009-2012 Cary R. (cygcary@yahoo.com) + * Copyright (c) 2009-2013 Cary R. (cygcary@yahoo.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 @@ -41,6 +41,7 @@ extern void vvp_net_pool_delete(void); extern void ufunc_pool_delete(void); extern void A_delete(class __vpiHandle *item); +extern void APV_delete(class __vpiHandle *item); extern void PV_delete(class __vpiHandle *item); extern void class_delete(class __vpiHandle *item); extern void constant_delete(class __vpiHandle *item);