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

local variable location fix #1942

Merged

Conversation

Tiko7454
Copy link
Contributor

When we had a function f() which returns a pair, the result passed to local variables didn't initialize the location attribute. For example: contract A {
function f() public returns (int, bytes memory) {
return (1, "asdf");
}
function g() public {
(int x, bytes memory y) = f();
}
}
the location of the local variable x as well as the location of the local variable y was None

@CLAassistant
Copy link

CLAassistant commented May 29, 2023

CLA assistant check
All committers have signed the CLA.

When we had a function f() which returns a pair, the result passed to
local variables didn't initialize the location attribute. For example:
contract A {
	function f() public returns (int, bytes memory) {
		return (1, "asdf");
	}
	function g() public {
		(int x, bytes memory y) = f();
	}
}
the location of the local variable x as well as the location of the
local variable y was None
@Tiko7454 Tiko7454 force-pushed the memory-location-fix-for-pair-function branch from ab34c49 to 6a68d33 Compare May 29, 2023 11:48
@smonicas
Copy link
Contributor

Hi thanks for your pr. You are correct that this is an issue. Your fix would probably work however a clearer way is to override _analyze_variable_attributes in local_variable_init_from_tuple.py like it's done in local_variable.py (you can copy paste and should just work).

@Tiko7454
Copy link
Contributor Author

Thank you for your prompt response. I have done the corrections you suggested.

@Tiko7454
Copy link
Contributor Author

Seems like this
Collecting requests<2.30 (from -r /home/runner/work/_actions/pypa/gh-action-pip-audit/v1.0.7/requirements.txt (line 4))
should be upgraded to 2.31 or something like that
(its from the log of pip-audit)

@smonicas
Copy link
Contributor

Don't worry about it, we will update it in another pr

@0xalpharush 0xalpharush merged commit 831b3b2 into crytic:master Jun 7, 2023
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.

4 participants