github / github/codeql

[Rust] Proc macro expansion support

未關閉
#20,659 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
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?

貢獻指南

開啟貢獻指南

研究方向

Start with the simple Anchor test described in the issue and use cargo expand to compare the original proc-macro source with the expanded file placed in the repository root. Check how CodeQL resolves references in each case. Done means establishing whether expanded proc macros are supported and documenting a reliable analysis approach or the required implementation scope.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
rust
領域
security
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。