forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Fix static analyzer concerns in #embed code (llvm#99331)
1. Dead code in `LookupEmbedFile`. The loop always exited on the first iteration. This was also causing a bug of not checking all directories provided by `--embed-dir`. 2. Use of uninitialized variable `CurTok` in `LexEmbedParameters`. It was used to initialize the field which seems to be unused. Removed unused field, this way `CurTok` should be initialized by Lex method.
- Loading branch information
Showing
3 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// RUN: %clang_cc1 -std=c23 %s -E -verify --embed-dir=%S --embed-dir=%S/Inputs | ||
// expected-no-diagnostics | ||
|
||
#embed <jk.txt> |