From c612a21a34c747ea21130fbaf3afae0ccf81ef3c Mon Sep 17 00:00:00 2001 From: sorawee Date: Tue, 26 Sep 2023 06:53:26 +0700 Subject: [PATCH] fix: only remove tmpdir when tmpdir actually is created (#38) It could be that tmpdir is never created, particularly in the --r1cs mode (so there is no circom compilation which requires tmpdir), and under the situation where propagation suffices for determining safety (so no need to call the solver => no need to create the smt2 file in the tmpdir). In such case, tmpdir is false, so Picus fails with a contract error. This commit fixes the problem. --- picus/tmpdir.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/picus/tmpdir.rkt b/picus/tmpdir.rkt index 164bd8d..9f22e8f 100644 --- a/picus/tmpdir.rkt +++ b/picus/tmpdir.rkt @@ -12,4 +12,5 @@ tmpdir) (define (clean-tmpdir!) - (delete-directory/files tmpdir #:must-exist? #f)) + (when tmpdir + (delete-directory/files tmpdir)))