Merge pull request from GHSA-ff4p-7xrq-q5r8

* x64: Remove incorrect `amode_add` lowering rules

This commit removes two incorrect rules as part of the x64 backend's
computation of addressing modes. These two rules folded a zero-extended
32-bit computation into the address mode operand, but this isn't correct
as the 32-bit computation should be truncated to 32-bits but when folded
into the address mode computation it happens with 64-bit operands,
meaning truncation doesn't happen.

* Add release notes
This commit is contained in:
Alex Crichton
2023-03-08 13:00:40 -06:00
committed by GitHub
parent 5dc2bbccbb
commit 63fb30e4b4
3 changed files with 52 additions and 20 deletions

View File

@@ -209,8 +209,9 @@ block0(v0: i64, v1: i32):
; pushq %rbp
; movq %rsp, %rbp
; block0:
; movl %esi, %ecx
; movq -1(%rdi,%rcx,8), %rax
; movq %rsi, %rdx
; shll $3, %edx, %edx
; movq -1(%rdi,%rdx,1), %rax
; movq %rbp, %rsp
; popq %rbp
; ret
@@ -220,8 +221,9 @@ block0(v0: i64, v1: i32):
; pushq %rbp
; movq %rsp, %rbp
; block1: ; offset 0x4
; movl %esi, %ecx
; movq -1(%rdi, %rcx, 8), %rax ; trap: heap_oob
; movq %rsi, %rdx
; shll $3, %edx
; movq -1(%rdi, %rdx), %rax ; trap: heap_oob
; movq %rbp, %rsp
; popq %rbp
; retq
@@ -244,7 +246,8 @@ block0(v0: i64, v1: i32, v2: i32):
; block0:
; movq %rsi, %r8
; addl %r8d, %edx, %r8d
; movq -1(%rdi,%r8,4), %rax
; shll $2, %r8d, %r8d
; movq -1(%rdi,%r8,1), %rax
; movq %rbp, %rsp
; popq %rbp
; ret
@@ -256,7 +259,8 @@ block0(v0: i64, v1: i32, v2: i32):
; block1: ; offset 0x4
; movq %rsi, %r8
; addl %edx, %r8d
; movq -1(%rdi, %r8, 4), %rax ; trap: heap_oob
; shll $2, %r8d
; movq -1(%rdi, %r8), %rax ; trap: heap_oob
; movq %rbp, %rsp
; popq %rbp
; retq