-
Notifications
You must be signed in to change notification settings - Fork 16
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(internal/utils): fix clobbering BP #288
Conversation
@@ -488,7 +488,7 @@ LBB3_5: | |||
DATA LCDATA3<>+0x000(SB)/8, $0x7fffffff80000000 | |||
GLOBL LCDATA3<>(SB), 8, $8 | |||
|
|||
TEXT ·_int32_max_min_avx2(SB), $0-32 | |||
TEXT ·_int32_max_min_avx2(SB), NOSPLIT, $8-32 |
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.
Is the NOSPLIT only needed here and not in the other locations?
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.
ah, I can probably add it to the other locations for the benefits
@@ -133,7 +133,7 @@ LBB0_5: | |||
JNE LBB0_9 | |||
JMP LBB0_10 | |||
|
|||
TEXT ·_uint8_max_min_avx2(SB), $0-32 | |||
TEXT ·_uint8_max_min_avx2(SB), NOSPLIT, $0-32 |
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'm not familiar with assembly but is $0
OK here? Should we use $8
like others?
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.
the $0
is the Frame Size. We only needed to update to $8
in the cases that included the LEAQ <something>, BP
instruction since those were clobbering the BP. By updating the frame size the Go assembler will automatically insert instructions to save/restore the BP. In the cases where we weren't clobbering it, we don't need to update or change the frame size.
Rationale for this change
Fixes #279
What changes are included in this PR?
In all instances where the generated assembly is clobbering the BP register, we insert a frame size so that the Go assembler will insert a save/restore of the BP, preventing the spurious crash discovered in #279
Are these changes tested?
There isn't really a consistent way to easily reproduce in a unit test, but I'm open to suggestions if anyone has one
Are there any user-facing changes?
No