@@ -318,7 +318,7 @@ def setup(ctx: FunctionContext) -> Exec:
318
318
)
319
319
320
320
setup_exs_all = sevm .run (setup_ex )
321
- setup_exs_no_error : list [Exec ] = []
321
+ setup_exs_no_error : list [tuple [ Exec , SMTQuery ] ] = []
322
322
323
323
for path_id , setup_ex in enumerate (setup_exs_all ):
324
324
if args .verbose >= VERBOSITY_TRACE_SETUP :
@@ -339,24 +339,25 @@ def setup(ctx: FunctionContext) -> Exec:
339
339
render_trace (setup_ex .context )
340
340
341
341
else :
342
- setup_exs_no_error .append (setup_ex )
342
+ # note: ex.path.to_smt2() needs to be called at this point. The solver object is shared across paths,
343
+ # and solver.to_smt2() will return a different query if it is called after a different path is explored.
344
+ setup_exs_no_error .append ((setup_ex , setup_ex .path .to_smt2 (args )))
343
345
344
346
setup_exs : list [Exec ] = []
345
347
346
348
match setup_exs_no_error :
347
349
case []:
348
350
pass
349
- case [ex ]:
351
+ case [( ex , _) ]:
350
352
setup_exs .append (ex )
351
353
case _:
352
- for path_id , ex in enumerate (setup_exs_no_error ):
354
+ for path_id , ( ex , query ) in enumerate (setup_exs_no_error ):
353
355
path_ctx = PathContext (
354
356
args = args ,
355
357
path_id = path_id ,
356
- query = ex . path . to_smt2 ( args ) ,
358
+ query = query ,
357
359
solving_ctx = ctx .solving_ctx ,
358
360
)
359
-
360
361
solver_output = solve_low_level (path_ctx )
361
362
if solver_output .result != unsat :
362
363
setup_exs .append (ex )
0 commit comments