mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
There was a mismatch between a `self.macro_context_level += 1` and the corresponding `self.macro_context_level -= 1`, which resulted in an `usize` underflow (panic in debug mode, wrong behaviour in release mode). This fixes it and adds a relevant assertion and test. In order to properly test library mode extraction, a special option enforcing that on source code as well is added.
11 lines
327 B
Plaintext
11 lines
327 B
Plaintext
import rust
|
|
import codeql.rust.Diagnostics
|
|
|
|
query predicate macro_items(MacroItems c, int index, Item expanded) {
|
|
exists(c.getFile().getRelativePath()) and
|
|
not c.getLocation().getFile().getAbsolutePath().matches("%proc_macro.rs") and
|
|
expanded = c.getItem(index)
|
|
}
|
|
|
|
query predicate warnings(ExtractionWarning w) { any() }
|