Skip to content

Conversation

@eternalcomet
Copy link
Contributor

Stack pointer of the user stack must be aligned to 16.

stack pointer of the user stack must be aligned to 16
stack.push_usize_slice(argv_slice.as_slice(), &mut data);
// Push argc
stack.push_usize_slice(&[args.len()], &mut data);
assert!(stack.get_sp() % 16 == 0);
Copy link
Owner

Choose a reason for hiding this comment

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

You can add stack.push("\0".repeat(stack.get_sp() % 16).as_bytes(), &mut data); code here instead of calculating the pointers_count.

@Azure-stars Azure-stars merged commit b319285 into Azure-stars:main May 15, 2025
5 checks passed
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.

2 participants