mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: ensure error and token locations are valid
The locations are "clipped" to the ranges of the parent node of a token, and the root node of the parse tree for errors.
This commit is contained in:
@@ -522,7 +522,7 @@ impl Translator<'_> {{
|
||||
writeln!(buf, " self.emit_location(label, &node);")?;
|
||||
writeln!(
|
||||
buf,
|
||||
" self.emit_tokens(label.into(), node.syntax().children_with_tokens());"
|
||||
" self.emit_tokens(&node, label.into(), node.syntax().children_with_tokens());"
|
||||
)?;
|
||||
writeln!(buf, " label")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user