-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
Disallow self.* calls to public functions #1561
Disallow self.* calls to public functions #1561
Conversation
if sig.private: | ||
return call_self_private(stmt_expr, context, sig) | ||
else: | ||
return call_self_public(stmt_expr, context, sig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a maintenance concern here which is that this will leave a bunch of dead code in the codebase. @jacqueswww @davesque thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is significant overlap between the removed function and external_contract_call
in vyper/parser/external_call.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well looking at call_self_public
= it doesn't really have that much dead code or functions it calls out to? Most of those functions are used by call_self_private
from what I checked.
Merged in master, tests are now passing. Things to still resolve:
|
…ncy_check Check constancy when calling to external function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👟
…mports Expand import system
@iamdefinitelyahuman rebase |
…missing-args Compile-time check for missing args in private calls
…fsets AST end offsets and compressed source map
…lyahuman/vyper into disallow-self-public
Hate to be this guy, but there's too much in the history to be merged. Can you part compress the history via |
had to do some ugly stuff to fix the commits, opening a new PR |
What I did
Prevent calls to public functions via
self
- fixes #1199How I did it
vyper/parser/self_call.py
, raiseStructureException
where previously there was a call tocall_self_public
How to verify it
Description for the changelog
Cute Animal Picture