Blame SOURCES/spirv-tools-fix.patch
|
|
70ac3e |
diff -up SPIRV-Tools-2019.1/tools/io.h.dm SPIRV-Tools-2019.1/tools/io.h
|
|
|
70ac3e |
--- SPIRV-Tools-2019.1/tools/io.h.dm 2019-02-18 14:14:46.362572748 +1000
|
|
|
70ac3e |
+++ SPIRV-Tools-2019.1/tools/io.h 2019-02-18 14:15:12.446271338 +1000
|
|
|
70ac3e |
@@ -34,13 +34,14 @@ bool ReadFile(const char* filename, cons
|
|
|
70ac3e |
while (size_t len = fread(buf, sizeof(T), buf_size, fp)) {
|
|
|
70ac3e |
data->insert(data->end(), buf, buf + len);
|
|
|
70ac3e |
}
|
|
|
70ac3e |
- if (ftell(fp) == -1L) {
|
|
|
70ac3e |
+ long _pos = ftell(fp);
|
|
|
70ac3e |
+ if (_pos == -1L) {
|
|
|
70ac3e |
if (ferror(fp)) {
|
|
|
70ac3e |
fprintf(stderr, "error: error reading file '%s'\n", filename);
|
|
|
70ac3e |
return false;
|
|
|
70ac3e |
}
|
|
|
70ac3e |
} else {
|
|
|
70ac3e |
- if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) {
|
|
|
70ac3e |
+ if (sizeof(T) != 1 && (_pos % sizeof(T))) {
|
|
|
70ac3e |
fprintf(
|
|
|
70ac3e |
stderr,
|
|
|
70ac3e |
"error: file size should be a multiple of %zd; file '%s' corrupt\n",
|