-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 BOF in the last channel handling logic of SSE ShuffleChannel #5735
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5735 +/- ##
===========================================
- Coverage 95.15% 90.03% -5.13%
===========================================
Files 793 265 -528
Lines 270315 77624 -192691
===========================================
- Hits 257218 69886 -187332
+ Misses 13097 7738 -5359 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Junwha Hong <[email protected]>
|
||
for (int i = 0; i < 4; i++) | ||
{ | ||
if (i % 2) | ||
{ | ||
*outptr = *ptr1; | ||
ptr1 += 1; | ||
} | ||
else | ||
{ | ||
*outptr = *ptr0; | ||
ptr0 += 1; | ||
} | ||
outptr += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unroll the tail part
for (int i = 0; i < 4; i++) | |
{ | |
if (i % 2) | |
{ | |
*outptr = *ptr1; | |
ptr1 += 1; | |
} | |
else | |
{ | |
*outptr = *ptr0; | |
ptr0 += 1; | |
} | |
outptr += 1; | |
} | |
{ | |
outptr[0] = ptr0[0]; | |
outptr[1] = ptr1[0]; | |
outptr[2] = ptr0[1]; | |
outptr[3] = ptr1[1]; | |
ptr0 += 2; | |
ptr1 += 2; | |
outptr += 4; | |
} |
ptr0 += 1; | ||
} | ||
outptr += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a risk of out of range reading in some of the pack8/pack16 codes.
for (int i = 0; i < 4; i++) | ||
{ | ||
if (i % 2) | ||
{ | ||
*outptr0 = *ptr1; | ||
ptr1 += 1; | ||
} | ||
else | ||
{ | ||
*outptr0 = *ptr0; | ||
ptr0 += 1; | ||
} | ||
outptr0 += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unroll this
|
||
for (int i = 0; i < 16; i++) | ||
{ | ||
if (i % 2) | ||
{ | ||
*outptr = *ptr1; | ||
ptr1 += 1; | ||
} | ||
else | ||
{ | ||
*outptr = *ptr0; | ||
ptr0 += 1; | ||
} | ||
outptr += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a risk of out of range reading in some of the pack8/pack16 codes.
|
||
for (int i = 0; i < 8; i++) | ||
{ | ||
if (i % 2) | ||
{ | ||
*outptr0 = *ptr1; | ||
ptr1 += 1; | ||
} | ||
else | ||
{ | ||
*outptr0 = *ptr0; | ||
ptr0 += 1; | ||
} | ||
outptr0 += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a risk of out of range reading in some of the arm pack8 codes.
|
||
for (int i = 0; i < 4; i++) | ||
{ | ||
if (i % 2) | ||
{ | ||
*outptr0 = *ptr1; | ||
ptr1 += 1; | ||
} | ||
else | ||
{ | ||
*outptr0 = *ptr0; | ||
ptr0 += 1; | ||
} | ||
outptr0 += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unroll this
Hi @nihui, Could I ask why do you think the out-of-bound risk does not exist in pack8/16 codes? Thank you for your effort on this issue! |
Fix #5734