github / github/codeql

[Rust] Proc macro expansion support

Aperta
#20,659 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
security
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.