Skip to content

Use StaticAnalyzer to deprecate msg.gas instead of conditionally remo…#3652

Merged
chriseth merged 1 commit intodevelopfrom
gasleft_v2
Mar 6, 2018
Merged

Use StaticAnalyzer to deprecate msg.gas instead of conditionally remo…#3652
chriseth merged 1 commit intodevelopfrom
gasleft_v2

Conversation

@ekpyron
Copy link
Collaborator

@ekpyron ekpyron commented Mar 5, 2018

…ving it in MagicType.

Closes #3650.

In #3643 msg.gas was deprecated by conditionally removing it from the MagicType in Types.cpp, resulting in an error for experimental v0.5.0, but no warning was issued when using msg.gas pre-v0.5.0.

The only way to add such a warning I found is in the StaticAnalyzer (I realized this possibility only now - before I had not seen a good place to issue such a warning at all).

Comparing the case of msg.gas with, for instance, the deprecation of callcode in favour of delegatecall, I now realize that the static analyzer may have been the better choice for deprecating msg.gas from the beginning. Therefore this pull request proposes to revert parts of the changes of #3643 and instead keeps msg.gas in MagicType, but issues a warning, resp. raises an error in the static analyzer.

I think this solution is more consistent with existing code than the original solution in #3643.

Alternatively, the changes of #3634 could be left untouched, and this pull request could be reduced to issuing the warning in the static analyzer only.

@ekpyron ekpyron requested review from axic, chriseth and erak March 5, 2018 22:41
@ekpyron ekpyron self-assigned this Mar 5, 2018
@chriseth chriseth merged commit f6c0dae into develop Mar 6, 2018
@axic axic deleted the gasleft_v2 branch March 6, 2018 09:04
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.

3 participants