From a8d43fa7435eb8da94ec8ebbfc2806d4d75348c4 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 25 Nov 2014 18:22:37 +0100 Subject: [PATCH] vvp: Stop simulation in case of errors in $ivl_string_method$to_vec. --- vpi/v2009_string.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vpi/v2009_string.c b/vpi/v2009_string.c index e9b98cb79..29dd3691d 100644 --- a/vpi/v2009_string.c +++ b/vpi/v2009_string.c @@ -149,12 +149,14 @@ static PLI_INT32 to_vec_calltf(ICARUS_VPI_CONST PLI_BYTE8*name) int vec_size = vpi_get(vpiSize, vec); if(str_size <= 0) { vpi_printf("ERROR: Cannot cast empty string"); - assert(0); + vpi_control(vpiFinish, 0); + return 0; } if(vec_size != str_size * 8) { vpi_printf("ERROR: String and vector size do not match"); - assert(0); + vpi_control(vpiFinish, 0); + return 0; } str_val.format = vpiStringVal;