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

Fix incorrect tuple type in case of low level call #539

Merged
merged 1 commit into from
Jul 19, 2020

Conversation

montyly
Copy link
Member

@montyly montyly commented Jul 19, 2020

The incorrect tuple types were only present for low level calls with solidity >= 0.5 (low level call return a tuple instead of a bool from 0.5)

Fix #529
Replace #536

Tested with

library Lib{

    function t() public returns(uint, bool){

    }
}

contract Tuple {

  function f()
    public
  {
    bool success;
    address dest;
    bytes memory returnValue;
    (success, returnValue) = dest.call("");
  }

  function get() internal returns(uint, bool);

  function test() public{
        uint a;
        bool b;
        (a,b) = get();

        (a,b) = Lib.t();
  }

}
Contract Tuple	Function Tuple.f() (*)
		Expression: (success,returnValue) = dest.call()
		IRs:
			TUPLE_0(bool,bytes) = LOW_LEVEL_CALL, dest:dest, function:call, arguments:['']  
			success(bool)= UNPACK TUPLE_0 index: 0 
			returnValue(bytes)= UNPACK TUPLE_0 index: 1 
	Function Tuple.get() (*)
	Function Tuple.test() (*)
		Expression: (a,b) = get()
		IRs:
			TUPLE_1(uint256,bool) = INTERNAL_CALL, Tuple.get()()
			a(uint256)= UNPACK TUPLE_1 index: 0 
			b(bool)= UNPACK TUPLE_1 index: 1 
		Expression: (a,b) = Lib.t()
		IRs:
			TUPLE_2(uint256,bool) = LIBRARY_CALL, dest:Lib, function:t, arguments:[] 
			a(uint256)= UNPACK TUPLE_2 index: 0 
			b(bool)= UNPACK TUPLE_2 index: 1 

@montyly montyly merged commit 3ffdbcd into dev Jul 19, 2020
@montyly montyly deleted the dev-fix-tuple-low-level branch July 27, 2020 07:21
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

Successfully merging this pull request may close these issues.

1 participant