From be10b1d4179db60fc1295be58626c3467c744efd Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Thu, 19 Oct 2023 06:47:07 +0900 Subject: Handle revisited meta sym var when generate env var I still have no clue in some cases why they are seen more than once. --- lib/Core/ExecutionState.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Core/ExecutionState.cpp b/lib/Core/ExecutionState.cpp index 3f92cccd..d6639208 100644 --- a/lib/Core/ExecutionState.cpp +++ b/lib/Core/ExecutionState.cpp @@ -419,7 +419,10 @@ std::string extractMetaEnvVar(ref e) { return ""; std::string value; constant->toString(value); - return "__SWITCH" + name.substr(8, name.size() - 8) + "=" + value; + unsigned char count = 1; + while (count < name.size() - 8 && name[count + 8] != '_') + ++count; + return "__SWITCH" + name.substr(8, count) + "=" + value; } void ExecutionState::addConstraint(ref e) { -- cgit 1.4.1