mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 00:18:45 +00:00
fix a couple hundred deref-after-free bugs due to .c_str() on a temporary string
This commit is contained in:
parent
48a9defb0d
commit
23e6adcad3
64 changed files with 248 additions and 229 deletions
|
@ -158,8 +158,8 @@ expr_ref pb_rewriter::mk_validate_rewrite(app_ref& e1, app_ref& e2) {
|
|||
}
|
||||
|
||||
std::ostringstream strm;
|
||||
strm << "x" << i;
|
||||
name = symbol(strm.str().c_str());
|
||||
strm << 'x' << i;
|
||||
name = symbol(strm.str());
|
||||
trail.push_back(m.mk_const(name, a.mk_int()));
|
||||
expr* x = trail.back();
|
||||
m.is_not(e,e);
|
||||
|
@ -190,7 +190,7 @@ void pb_rewriter::validate_rewrite(func_decl* f, unsigned sz, expr*const* args,
|
|||
void pb_rewriter::dump_pb_rewrite(expr* fml) {
|
||||
std::ostringstream strm;
|
||||
strm << "pb_rewrite_" << (s_lemma++) << ".smt2";
|
||||
std::ofstream out(strm.str().c_str());
|
||||
std::ofstream out(strm.str());
|
||||
ast_smt_pp pp(m());
|
||||
pp.display_smt2(out, fml);
|
||||
out.close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue