macro_via: disjunctive #undef terminators leave dead macros live

Đang mở
#193 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 2 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

Start with src/database/macro_via.rs and read the deferred change in commit a2fe71e, focusing on guard overlap and how #undef terminators are handled. Use the C reproducer to check callers of target; done means the query no longer reports a via RUN edge when the combined #undef RUN guards cover every build.

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

Mô tả

When a function-like macro is #undef'd across multiple complementary preprocessor branches, macro_via treats each terminator independently and leaves the macro live, producing a false caller edge.

Reproducer

int target(void) { return 1; }
#define RUN(f) f()
#define FLAG 1
#if BRANCH
#undef RUN
#undef FLAG
#endif
#ifdef FLAG
#undef RUN
#endif
int caller(void) { return RUN(target); }

Querying callers of target reports caller via RUN, even though RUN is undefined in every build (BRANCH undefines RUN and FLAG; !BRANCH keeps FLAG defined and undefines RUN).

Cause

Deferred in a2fe71e: each #undef is uncertain on its own, and the guard overlap engine in src/database/macro_via.rs does not yet prove disjunctive terminator coverage across branches.

Expected behavior

callers target should not report a via RUN edge when the union of #undef RUN guards covers every build.

Ngôn ngữ chính
Rust
Star
187
Fork
53
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
79

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 facebookexperimental/semcode

Tất cả issue của facebookexperimental/semcode

Issue tương tự

Thêm issue về Rust

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.