From ec039b63748c2a95f89c0538a843e18d3a51cdf3 Mon Sep 17 00:00:00 2001 From: Lucas Franceschino Date: Mon, 3 Jun 2024 16:53:09 +0200 Subject: feat: basic handling for `RValue::Len`, following AeneasVerif/charon#209 --- compiler/FunsAnalysis.ml | 4 +++- compiler/InterpreterExpressions.ml | 1 + compiler/InterpreterStatements.ml | 1 + compiler/InterpreterUtils.ml | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/FunsAnalysis.ml b/compiler/FunsAnalysis.ml index eadd8f8a..815c470f 100644 --- a/compiler/FunsAnalysis.ml +++ b/compiler/FunsAnalysis.ml @@ -103,7 +103,9 @@ let analyze_module (m : crate) (funs_map : fun_decl FunDeclId.Map.t) method! visit_rvalue _env rv = match rv with - | Use _ | RvRef _ | Global _ | Discriminant _ | Aggregate _ -> () + | Use _ | RvRef _ | Global _ | Discriminant _ | Aggregate _ | Len _ + -> + () | UnaryOp (uop, _) -> can_fail := unop_can_fail uop || !can_fail | BinaryOp (bop, _, _) -> can_fail := binop_can_fail bop || !can_fail diff --git a/compiler/InterpreterExpressions.ml b/compiler/InterpreterExpressions.ml index 2223897c..56c0ab5f 100644 --- a/compiler/InterpreterExpressions.ml +++ b/compiler/InterpreterExpressions.ml @@ -816,6 +816,7 @@ let eval_rvalue_not_global (config : config) (span : Meta.span) "Unreachable: discriminant reads should have been eliminated from the \ AST" | Global _ -> craise __FILE__ __LINE__ span "Unreachable" + | Len _ -> craise __FILE__ __LINE__ span "Unhandled Len" let eval_fake_read (config : config) (span : Meta.span) (p : place) : cm_fun = fun ctx -> diff --git a/compiler/InterpreterStatements.ml b/compiler/InterpreterStatements.ml index c6a65757..c60be905 100644 --- a/compiler/InterpreterStatements.ml +++ b/compiler/InterpreterStatements.ml @@ -950,6 +950,7 @@ let rec eval_statement (config : config) (st : statement) : stl_cm_fun = let cc = match rvalue with | Global _ -> craise __FILE__ __LINE__ st.span "Unreachable" + | Len _ -> craise __FILE__ __LINE__ st.span "Unhandled Len" | Use _ | RvRef (_, (BShared | BMut | BTwoPhaseMut | BShallow)) | UnaryOp _ | BinaryOp _ | Discriminant _ | Aggregate _ -> diff --git a/compiler/InterpreterUtils.ml b/compiler/InterpreterUtils.ml index 653a0e24..f3f12906 100644 --- a/compiler/InterpreterUtils.ml +++ b/compiler/InterpreterUtils.ml @@ -291,7 +291,7 @@ let rvalue_get_place (rv : rvalue) : place option = match rv with | Use (Copy p | Move p) -> Some p | Use (Constant _) -> None - | RvRef (p, _) -> Some p + | Len (p, _, _) | RvRef (p, _) -> Some p | UnaryOp _ | BinaryOp _ | Global _ | Discriminant _ | Aggregate _ -> None (** See {!ValuesUtils.symbolic_value_has_borrows} *) -- cgit v1.2.3 From ee11f8135281d34e76c31f4d001854ba11546007 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 4 Jun 2024 09:24:11 +0200 Subject: Update charon pin --- charon-pin | 2 +- flake.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charon-pin b/charon-pin index d18033b9..285b511b 100644 --- a/charon-pin +++ b/charon-pin @@ -1,2 +1,2 @@ # This is the commit from https://github.com/AeneasVerif/charon that should be used with this version of aeneas. -a5fda598f359a2b85e044a884fd977d75f4578b4 +ae610b59b337b191d23f4f1c738ed290b8edd0d2 diff --git a/flake.lock b/flake.lock index 712de213..974a3e25 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1716552262, - "narHash": "sha256-anBm+nYYp1IDHb+9Dk5oMv28OK/vjcf+wuFI3IRjKrA=", + "lastModified": 1717443886, + "narHash": "sha256-6tX6AgXQlIIuiKLOij0H2mf00rhU02hbQhs3lTARgMk=", "owner": "aeneasverif", "repo": "charon", - "rev": "a5fda598f359a2b85e044a884fd977d75f4578b4", + "rev": "ae610b59b337b191d23f4f1c738ed290b8edd0d2", "type": "github" }, "original": { -- cgit v1.2.3 From d53dcc06e69b6d607261781b4bfc09c52b737a91 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 4 Jun 2024 09:29:41 +0200 Subject: Fix the CI pin check --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ee28837..17ed0f26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,4 +59,6 @@ jobs: runs-on: [self-hosted, linux, nix] steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # deep clone in order to get access to other commits - run: nix develop --command ./scripts/ci-check-charon-pin.sh -- cgit v1.2.3