Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

AvoidReinterprets: `i32.atomic.load` under `f32.reinterpret_i32` loses its atomicity

Đang mở Phù hợp với người mới
#9,185 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
wasm
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu trong pass AvoidReinterprets tại makeReinterpretedLoad và tái hiện vấn đề với module .wat được cung cấp bằng wasm-opt --avoid-reinterprets --print. Hoàn thành khi một i32.atomic.load không bị viết lại thành một f32.load không nguyên tử, bảo toàn hành vi truy cập ban đầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

makeReinterpretedLoad rebuilds the load from bytes/offset/align/ptr/type/memory and does not carry over isAtomic.

Root cause

The rebuilt load copies the listed fields only, so the original load's isAtomic is dropped.

Copying isAtomic is not a fix, because atomic loads exist only for i32 and i64 (the validator rejects other types) and the rebuilt load has type f32. The pass should skip atomic loads.

Affected passes

Only AvoidReinterprets.

Reproducer
(module (memory 1 1)
  (func (export "f") (param $p i32) (result f32)
    (f32.reinterpret_i32 (i32.atomic.load (local.get $p)))))
$ wasm-opt in.wat -all --avoid-reinterprets --print
 (func $0 (type $0) (param $p i32) (result f32)
  (f32.load
   (local.get $p)
  )
 )

The i32.atomic.load has become a plain f32.load.

Expected vs actual

An unaligned address that traps for the atomic access no longer traps, and on a shared memory the access is no longer atomic.

Version

Reproduced on upstream main at 4d8ac549e2ab9b283246ea95e79ebe139ca579ac (wasm-opt version 133).

AI was used as part of the process of finding this issue. I have manually checked and reproduced it.

Ngôn ngữ chính
WebAssembly
Star
8.7k
Fork
893
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
77

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WebAssembly/binaryen

Tất cả issue của WebAssembly/binaryen

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.