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

feat(code-backend) implemented extractors in backend to avoid accidental memory registry creation #4381

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Lazark0x
Copy link
Member

@Lazark0x Lazark0x commented Dec 7, 2024

Resolves #3891

Implemented extractors as proposed in issue #3891
Extractors are used in methods with a variable number of arguments, while having a variable number of constructor arguments themselves.
After all extractors have been created, the MemoryAccessRegistry::pre_process() method is called
If the method did not need any extractors, the MemoryAccessRegistry::pre_process() method will not be called either

@Lazark0x Lazark0x self-assigned this Dec 7, 2024
.into_inner()
.map_err(Into::into)
})
pub fn read(at: u32, buffer: Write) -> impl Syscall<Caller> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it a bug, changing order of args?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but no. The arguments are in reverse order, but there is no other way but to change the syscall signature, which is obviously not worth it.

let ptr = SyscallValue(args[1]).try_into()?;
let size = SyscallValue(args[0]).try_into()?;

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.

Use extractors in backend to avoid accidental memory registry creation
2 participants