View gist:2ba27dbb8766a4f16fcb
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
diff --git a/ELF/OutputSections.cpp b/ELF/OutputSections.cpp | |
index c941993..cefdb46 100644 | |
--- a/ELF/OutputSections.cpp | |
+++ b/ELF/OutputSections.cpp | |
@@ -844,8 +844,8 @@ static bool compCtors(const InputSection<ELFT> *A, | |
assert(Y.startswith(".ctors") || Y.startswith(".dtors")); | |
X = X.substr(6); | |
Y = Y.substr(6); | |
- if (X.empty() || Y.empty()) | |
- return X.empty(); |
View gist:283099fd4e5214264d9e
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
diff --git a/ELF/OutputSections.cpp b/ELF/OutputSections.cpp | |
index b885601..1a6fbc1 100644 | |
--- a/ELF/OutputSections.cpp | |
+++ b/ELF/OutputSections.cpp | |
@@ -1385,18 +1385,22 @@ StringTableSection<ELFT>::StringTableSection(StringRef Name, bool Dynamic) | |
// we obtained in the former function can be written in the latter. | |
// This design eliminated that need. | |
template <class ELFT> void StringTableSection<ELFT>::reserve(StringRef S) { | |
- Reserved += S.size() + 1; // +1 for NUL | |
+ if (Seen.insert(S).second) |
View gist:2a3b97720812aff656ab
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
diff --git a/src/util.cc b/src/util.cc | |
index 746d7ed..3a3c7df 100644 | |
--- a/src/util.cc | |
+++ b/src/util.cc | |
@@ -190,6 +190,9 @@ bool CanonicalizePath(char* path, size_t* len, unsigned int* slash_bits, | |
bits_offset--; | |
bits = ShiftOverBit(bits_offset, bits); | |
#endif | |
+ } else if (*start == '/') { | |
+ src += 3; |
View gist:6959261
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
(defun list (expr . rest) | |
(cons expr rest)) | |
(defun zero? (expr) | |
(= expr 0)) | |
(defun nil? (expr) | |
(eq expr ())) | |
(defmacro let1 (var val . body) |
View gist:2018964
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
int print_board(int board[][8]) { | |
for (int i = 0; i < 8; i++) { | |
for (int j = 0; j < 8; j++) { | |
if (board[i][j]) | |
printf("Q "); | |
else | |
printf(". "); | |
} | |
printf("\n"); | |
} |
View gist:2014832
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
int print_board(int *board) { | |
for (int i = 0; i < 8; i = i + 1) { | |
for (int j = 0; j < 8; j =j +1) { | |
int *v = board + i * 8 + j; | |
if (*v) { | |
printf("Q "); | |
} else { | |
printf(". "); | |
} | |
} |
NewerOlder