Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

[Bug] inline function crash case A #870

Open
@ghost

Description

🐛 Bug

It crashed.

To reproduce

Code snippet to reproduce

module me::test3 {
    use liquidswap::liquidity_pool::{get_reserves_size};

    public inline fun reserves_liquidswap<A, B, Curve>(order: bool, a1: u128, a2: u128) {
        if (order) {
            let (xx, yy) = get_reserves_size<A, B, Curve>();
            a1 = (xx as u128);
            a2 = (yy as u128);
        } else {
            let (yy, xx) = get_reserves_size<B, A, Curve>();
            a2 = (yy as u128);
            a1 = (xx as u128);
        };
    }

    public fun a<X, Y, Curve>(order: bool) {
        let (x, y);
        reserves_liquidswap<X, Y, Curve>(order, x, y);
    }
}
[package]
name = 'ass'
version = '1.0.0'
[dependencies]
AptosFramework={local="../af"}
Liquidswap={local="../iface/liquidswap"}
[addresses]
me = "0xd1b58e44ea11ffd326a280c453b080fd8af294298815a00e65b6e2bffc48d6ac"

Stack trace/error message

// Paste the output here
$ ./aptos move publish --bytecode-version 6 --skip-fetch-latest-git-deps --profile dev --included-artifacts none --package-dir ./assembly
Compiling, may take a little while to download git dependencies...
INCLUDING DEPENDENCY AptosFramework
INCLUDING DEPENDENCY AptosStdlib
INCLUDING DEPENDENCY Liquidswap
INCLUDING DEPENDENCY MoveStdlib
BUILDING ass
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/runner/.cargo/git/checkouts/move-0639dd674f581c30/2336fe2/language/move-compiler/src/hlir/translate.rs:153:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected Behavior

I don't know, you define it what should be.

System information

Please complete the following information:

Aptos CLI 1.0.4

1.64.0

Arch Linux

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions