You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to refresh the status of #60495 I noticed that ast::InlineAsm (and its nested structures) is the only AST structure that uses plain strings String and Symbols.
Other literals in AST use either ast::Lit in contexts where arbitrary literals are supported, of ast::StrLit in contexts where only string literals (possibly raw) are supported.
This is suspicious and may mean that string literals used in inline assembly are not always unescaped as any other Rust string literals.
"Unescaped as any other Rust string literals" means that e.g. "\x72ax" is always treated as semantically equivalent to "rax".
Implementation of inline assembly needs to be audited to make sure that the unescaping happens in all contexts, and some parts of ast::InlineAsm may need to use StrLit instead of plain strings or symbols.
The text was updated successfully, but these errors were encountered:
If StrLit is used in AST for inline assembly, then fn print_string/print_symbol in compiler\rustc_ast_pretty\src\pprust\state.rs should also be eliminated.
When trying to refresh the status of #60495 I noticed that
ast::InlineAsm
(and its nested structures) is the only AST structure that uses plain stringsString
andSymbol
s.Other literals in AST use either
ast::Lit
in contexts where arbitrary literals are supported, ofast::StrLit
in contexts where only string literals (possibly raw) are supported.This is suspicious and may mean that string literals used in inline assembly are not always unescaped as any other Rust string literals.
"Unescaped as any other Rust string literals" means that e.g.
"\x72ax"
is always treated as semantically equivalent to"rax"
.Implementation of inline assembly needs to be audited to make sure that the unescaping happens in all contexts, and some parts of
ast::InlineAsm
may need to useStrLit
instead of plain strings or symbols.The text was updated successfully, but these errors were encountered: