From dc1038c877cd68dbd9a7543007527b4b1987ae3c Mon Sep 17 00:00:00 2001 From: Mason Loyet Date: Thu, 17 Aug 2023 05:44:31 +0000 Subject: [PATCH] Fix Typo in vvp's scope search in interactive mode. When vvp parses a command which it thinks is a system call it tries to match the symbols to values in the scope. The typo uses the wrong index variable to access the vpi table. This results in a failed dynamic cast which goes unchecked until the value is dereferenced, resulting in a segfault. --- vvp/stop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vvp/stop.cc b/vvp/stop.cc index 8a6970006..b28696a28 100644 --- a/vvp/stop.cc +++ b/vvp/stop.cc @@ -138,7 +138,7 @@ static void cmd_call(unsigned argc, char*argv[]) case vpiTask: case vpiNamedBegin: case vpiNamedFork: - scope = dynamic_cast<__vpiScope*>(table[idx]); + scope = dynamic_cast<__vpiScope*>(table[tmp]); if (strcmp(scope->scope_name(), argv[idx+1]) == 0) handle = table[tmp]; break;