macro_via: disjunctive #undef terminators leave dead macros live

オープン
#193 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
187
フォーク
53
平均マージ
1日 9時間
マージ済み PR(30日)
79

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

facebookexperimental/semcode のほかの issue

facebookexperimental/semcode の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。