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

Function name "set_dynamic_callstack" is not good #355

Open
loloicci opened this issue Jul 8, 2024 · 0 comments
Open

Function name "set_dynamic_callstack" is not good #355

loloicci opened this issue Jul 8, 2024 · 0 comments
Labels
dynamic_link relate the dynamic link call feature

Comments

@loloicci
Copy link
Contributor

loloicci commented Jul 8, 2024

/// this function sets callstack to environment and checks it is not re-entrance
pub fn set_dynamic_callstack(&self, callstack: Vec<Addr>) -> VmResult<()> {

The name set_dynamic_callstack is not good.

  1. set_dynamic_callstack not only sets the call stack but also validates that the call stack does not have the called contract's address.
  2. set_dynamic_callstack adds the called contract's address to the top of the call stack rather than sets.

Renaming this function's name affects wasmvm (https://github.com/Finschia/wasmvm/blob/1e43355ed2255e4aed7fabb2e4323caa2bd3e02a/libwasmvm/src/dynamic_link.rs#L152).

@loloicci loloicci changed the title Function name "set_dynamic_callstack" has not enough info (this validats callstack) Function name "set_dynamic_callstack" is bad Jul 8, 2024
@loloicci loloicci changed the title Function name "set_dynamic_callstack" is bad Function name "set_dynamic_callstack" is not good Jul 8, 2024
@loloicci loloicci added the dynamic_link relate the dynamic link call feature label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamic_link relate the dynamic link call feature
Projects
None yet
Development

No branches or pull requests

1 participant