3 Commits

Author SHA1 Message Date
Daniil Kovalev
3105cfe783
[FileCheck] Fix parsing empty global and pseudo variable names (#83667)
Reland #82595 with fixes of build failures related to colored output.
See https://lab.llvm.org/buildbot/#/builders/139/builds/60549
Use `%ProtectFileCheckOutput` to avoid colored output.
Original commit message below.

In `Pattern::parseVariable`, for global variables (those starting with '$')
and for pseudo variables (those starting with '@') the first character is
consumed before actual variable name parsing. If the name is empty, it
leads to out-of-bound access to the corresponding `StringRef`.

This patch adds an if statement against the case described.
2024-03-05 11:20:16 +03:00
Daniil Kovalev
28b354a960
Revert "[FileCheck] Fix parsing empty global and pseudo variable names" (#83657)
Reverts llvm/llvm-project#82595

See build failure
https://lab.llvm.org/buildbot/#/builders/139/builds/60549
2024-03-02 08:09:10 +03:00
Daniil Kovalev
aab3d13179
[FileCheck] Fix parsing empty global and pseudo variable names (#82595)
In `Pattern::parseVariable`, for global variables (those starting with
'$') and for pseudo variables (those starting with '@') the first
character is consumed before actual variable name parsing. If the name
is empty, it leads to out-of-bound access to the corresponding
`StringRef`.

This patch adds an if statement against the case described.
2024-03-02 07:03:50 +03:00