aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>2025-04-15 09:43:01 +0200
committerGitHub <noreply@github.com>2025-04-15 09:43:01 +0200
commit0f526498a1b0819055d1094fd9850fdbcab5b903 (patch)
tree0c71f219674ac7e94421708da6ed1fc5877e27f8 /clang/lib/Basic/FileManager.cpp
parent17b4cacbd48b75a6a4c9dfe687dd39f5e88189c3 (diff)
downloadllvm-0f526498a1b0819055d1094fd9850fdbcab5b903.zip
llvm-0f526498a1b0819055d1094fd9850fdbcab5b903.tar.gz
llvm-0f526498a1b0819055d1094fd9850fdbcab5b903.tar.bz2
[clang] Reject character devices in #embed for now (#135370)
See https://github.com/llvm/llvm-project/issues/126629 . Right now they are not supported properly and support requires modifying several layers of LLVM. For now simply reject them while proper support is being developed to avoid potential security problems.
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index ec84aad..86fe352 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -330,6 +330,8 @@ llvm::Expected<FileEntryRef> FileManager::getFileRef(StringRef Filename,
UFE->UID = NextFileUID++;
UFE->UniqueID = Status.getUniqueID();
UFE->IsNamedPipe = Status.getType() == llvm::sys::fs::file_type::fifo_file;
+ UFE->IsDeviceFile =
+ Status.getType() == llvm::sys::fs::file_type::character_file;
UFE->File = std::move(F);
if (UFE->File) {