You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, when calling a tailcc function in tail position, rsp is increased in a branch where it has never been decreased. This leads to corrupted stack pointer (and probably a segfault) in the following function.
repro: # @repro# %bb.0:testrdi,rdije .LBB0_2# %bb.1: # %asubrsp,32xorpsxmm0,xmm0movaps xmmword ptr [rsp+8],xmm0movrax, qword ptr [rsp+32]movaps xmmword ptr [rsp+24],xmm0mov qword ptr [rsp],raxmovesi,16xoredi,edixoredx,edxmovecx,1xorr8d,r8dxorr9d,r9djmp f1@PLT # TAILCALL.LBB0_2: # %baddrsp,32 # <-rsp should not be increased here, as it is only decreased in branch "%a"jmp f2@PLT # TAILCALL # -- End function
As far as I can see, the issue does not occur on aarch64. There the stack pointer is decremented right at the beginning (before the branch), so the increment before the tail call is correct.
The text was updated successfully, but these errors were encountered:
In some cases, when calling a tailcc function in tail position, `rsp` is increased in a branch where it has never been decreased. This leads to corrupted stack pointer (and probably a segfault) in the following function.
repro: # @<!---->repro# %bb.0:testrdi,rdije .LBB0_2# %bb.1: # %asubrsp,32xorpsxmm0,xmm0movaps xmmword ptr [rsp+8],xmm0movrax, qword ptr [rsp+32]movaps xmmword ptr [rsp+24],xmm0mov qword ptr [rsp],raxmovesi,16xoredi,edixoredx,edxmovecx,1xorr8d,r8dxorr9d,r9djmp f1@<!---->PLT # TAILCALL.LBB0_2: # %baddrsp,32 # <- rsp should not be increased here, as it is only decreased in branch "%a"jmp f2@<!---->PLT # TAILCALL # -- End function
As far as I can see, the issue does not occur on aarch64. There the stack pointer is decremented right at the beginning (before the branch), so the increment before the tail call is correct.
In some cases, when calling a tailcc function in tail position,
rsp
is increased in a branch where it has never been decreased. This leads to corrupted stack pointer (and probably a segfault) in the following function.Repro:
Resulting assembly:
https://godbolt.org/z/ze7r8j67o
As far as I can see, the issue does not occur on aarch64. There the stack pointer is decremented right at the beginning (before the branch), so the increment before the tail call is correct.
The text was updated successfully, but these errors were encountered: