Skip to content

panic: unexpected 0 destinations for operation TraceLocal(0) #544

@msaaltink

Description

@msaaltink
module nesting::nesting;

use sui::object_table::ObjectTable;
use prover::prover::{asserts, ensures, forall, requires};

public struct S has store, key {id: UID, x: u8, y: u8}

#[ext(pure)]
public fun is_good_S(s: &S): bool {
    s.x > 0
}

public fun table_is_good(t: &ObjectTable<ID, S>): bool {
    forall!(|i| id_is_good(*i, t))
}

#[ext(pure)]
public fun id_is_good(i: ID, t: &ObjectTable<ID, S>): bool {
    !t.contains(i) || is_good_S(&t[i])
}

public struct T {m: ObjectTable<ID, S>, z: u8}

#[ext(pure)]
fun is_good_T(t: &T): bool {
    table_is_good(&t.m) && t.z < 100
}

gives a panic:

thread 'main' (152078) panicked at crates/move-prover-boogie-backend/src/boogie_backend/bytecode_translator.rs:3112:25:
unexpected 0 destinations for operation TraceLocal(0) in function nesting::table_is_good

This does not happen if the pure marker is removed from is_good_T.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions