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

Parameters validation in call_function opcodes. #56

Merged
merged 5 commits into from
Jan 6, 2024

Conversation

MiranDMC
Copy link
Collaborator

@MiranDMC MiranDMC commented Jan 2, 2024

Updated string params handling.

@MiranDMC MiranDMC requested a review from x87 January 2, 2024 21:46
@MiranDMC MiranDMC force-pushed the error_checks_in_function_call_opcodes branch from 7b16a43 to 15b1a03 Compare January 6, 2024 09:32
source/CCustomOpcodeSystem.cpp Outdated Show resolved Hide resolved
test ecx, ecx
jz call_func_this_end
mov ecx, struc
call_func_this_end:
Copy link

@x87 x87 Jan 6, 2024

Choose a reason for hiding this comment

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

micro-optimization:

since you used ecx for intermediate calculations, we could assign ecx to struct regardless of thisCall value. It could be a garbage value, could be not, the callee will use it if needed.

ie.

// set struct pointer for this call
mov ecx, struc
// call function
xor eax, eax
call func

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True. Even better, as unused struc has value 0.
Updated.

@MiranDMC MiranDMC merged commit d560e83 into master Jan 6, 2024
@MiranDMC MiranDMC deleted the error_checks_in_function_call_opcodes branch January 6, 2024 21:41
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