Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on using library functions #42

Closed
laugan-ton opened this issue Mar 19, 2021 · 2 comments
Closed

Segmentation fault on using library functions #42

laugan-ton opened this issue Mar 19, 2021 · 2 comments

Comments

@laugan-ton
Copy link

laugan-ton commented Mar 19, 2021

Here is what I get:

line 29:   733 Segmentation fault      (core dumped) 

With this code:

pragma ton-solidity >=0.38.2;

library B {     

    function B2(uint128 value) public pure returns (uint128) {        
        return 20;
    }     

    // GOOD
    function B1(uint128 amountIn) public pure returns (uint128 outAmountX, uint128 outAmountY) {
        outAmountX = 10;
        outAmountY = B2(10);
    }   
}

contract A {

    struct SomeVal {
        uint128 amountX; 
        uint128 amountY;
    }       

    mapping(uint256 => SomeVal) list1_;    

    function func1(address _tokenAddress, uint256 _senderKey, address _senderOwner, uint128 _tokens) public {
        list1_.add(_senderKey,SomeVal(uint128(10),uint128(20)));
        SomeVal trans = list1_.fetch(_senderKey).get();
        (trans.amountX, trans.amountY) = B.B1(10);
    }          

}
@IgorKoval
Copy link
Collaborator

Confirmed. To be fixed in the upcoming release.

@BorisI
Copy link
Collaborator

BorisI commented Apr 13, 2021

Fixed in 0.41.

@BorisI BorisI closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants