3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-07 22:04:53 +00:00

Fix dangling pointer in fresh variable name construction in generate_extensions()

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-03 21:53:55 +00:00
parent 0bdec633d7
commit 927b03615c

View file

@ -552,7 +552,8 @@ namespace seq {
// Const Nielsen modifier: lhs starts with char, rhs starts with var
// -> substitute rhs_var = char . fresh_var
if (lhead->is_char() && rhead->is_var()) {
symbol fresh_name(("v!" + std::to_string(node->id())).c_str());
std::string fresh_str = "v!" + std::to_string(node->id());
symbol fresh_name(fresh_str.c_str());
euf::snode* fresh = m_sg.mk_var(fresh_name);
euf::snode* replacement = m_sg.mk_concat(lhead, fresh);
@ -565,7 +566,8 @@ namespace seq {
}
if (rhead->is_char() && lhead->is_var()) {
symbol fresh_name(("v!" + std::to_string(node->id())).c_str());
std::string fresh_str = "v!" + std::to_string(node->id());
symbol fresh_name(fresh_str.c_str());
euf::snode* fresh = m_sg.mk_var(fresh_name);
euf::snode* replacement = m_sg.mk_concat(rhead, fresh);