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

fix: check variadic function's cap before calling #30

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

Sychorius
Copy link
Collaborator

@Sychorius Sychorius commented Aug 3, 2023

Change-Id: Ic9ac689e33484828b27adeca2d342e87c4230362

What type of PR is this?

fix

What this PR does / why we need it (en: English/zh: Chinese):

en: There are a few cases that lastArgs.cap == 0 but lastArg.len == MAX_INT when calling variadic functions (arm64). Currently we have no idea how it happens. In that case we assume that lastArgs.len should less than lastArg.cap
zh: 在一些极少情况下mock可变长参数的函数,调用时最后的变长参数slice的len会变得很大,但是cap为0。目前还不清楚为什么slice的len被踩坏了,这里先做一个校验,如果len>cap的话按照cap长度调用mock函数

Which issue(s) this PR fixes:

Change-Id: Ic9ac689e33484828b27adeca2d342e87c4230362
@Sychorius Sychorius marked this pull request as ready for review August 3, 2023 11:37
@Sychorius Sychorius merged commit 784cc5e into main Aug 3, 2023
@Sychorius Sychorius deleted the fix/variadic branch October 7, 2023 07:48
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