solang icon indicating copy to clipboard operation
solang copied to clipboard

Function selector comparison causes compilation crash.

Open Subway2023 opened this issue 10 months ago • 1 comments

Version: v0.3.3: Atlantis

contract C {
    function f() public pure returns (bool ret) {
        return f == f;
    }
}
(base) root@inplus-MS-7885:/mnt/sdd1/sbw/crossCompilerFuzz# solang compile --target solana  test.sol

thread 'main' panicked at 'Found PointerValue(PointerValue { ptr_value: Value { name: "C::C::function::f", address: 0x5c21fbf59718, is_const: true, is_null: false, is_undef: false, llvm_value: "define internal i64 @\"C::C::function::f\"(ptr %0, ptr %1) {\nentry:\n}\n", llvm_type: "ptr" } }) but expected the IntValue variant', /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inkwell-0.2.0/src/values/enums.rs:286:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Subway2023 avatar Feb 07 '25 14:02 Subway2023

contract C {
    function f() public view returns (bool ret) {
        return this.f == this.f;
    }
    function g() public view returns (bool ret) {
        return this.f != this.f;
    }
}
thread 'main' panicked at 'Found PointerValue(PointerValue { ptr_value: Value { name: "", address: 0x5c4c4656fdc0, is_const: false, is_null: false, is_undef: false, llvm_value: "  %2 = call ptr @__malloc(i32 ptrtoint (ptr getelementptr ({ i64, [32 x i8] }, ptr null, i32 1) to i32))", llvm_type: "ptr" } }) but expected the IntValue variant', /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inkwell-0.2.0/src/values/enums.rs:286:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Subway2023 avatar Feb 08 '25 04:02 Subway2023