-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aarch64_wheel] Fix readdir crash (#1574)
Probably fixes pytorch/pytorch#111695 (cherry picked from commit c5e331c)
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/src/cpu/aarch64/xbyak_aarch64/src/util_impl.cpp b/src/cpu/aarch64/xbyak_aarch64/src/util_impl.cpp | ||
index cb800b2509..5516373b90 100644 | ||
--- a/src/cpu/aarch64/xbyak_aarch64/src/util_impl.cpp | ||
+++ b/src/cpu/aarch64/xbyak_aarch64/src/util_impl.cpp | ||
@@ -170,6 +170,8 @@ int Cpu::getFilePathMaxTailNumPlus1(const char *path) { | ||
fflush(stdout); | ||
|
||
DIR *dir = opendir(dir_path); | ||
+ if (dir == NULL) | ||
+ return 0; | ||
struct dirent *dp; | ||
|
||
dp = readdir(dir); | ||
|