github / github/codeql

[Rust] Proc macro expansion support

オープン
#20,659 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

Hello, is there any way or are you planning to implement analysis on expanded proc macros? Im currently trying codeQL on [Anchor](https://crates.io/crates/anchor-lang), which makes heavy use of proc macros.

When running a simple test, I see that by default, codeQL doesn't fully resolve references that exist in the expanded code, meaning i only get a reference to the macro that generated the referenced code, but I dont know which part of the macro is to blame (i used `cargo expand`) to test that. It seems though that placing the expanded file in the root dir does indeed make it be analyzed, but I dont know if this fully supported at the moment.

Is there a better way to do this?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

issue に記載されている単純な Anchor テストから始め、cargo expand を使用して、元の proc-macro ソースとリポジトリルートに配置した展開後のファイルを比較します。それぞれの場合に CodeQL が参照をどのように解決するかを確認します。展開された proc macro がサポートされているかどうかを明らかにし、信頼できる解析アプローチまたは必要な実装範囲を文書化できれば完了です。

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

評価

技術スタック
rust
領域
security
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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