llvm.org GIT mirror llvm / d363ff3
The computation of string length is not that complicated. Fix it, again. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130967 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 9 years ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
139139 // A GCOV string is a length, followed by a NUL, then between 0 and 3 NULs
140140 // padding out to the next 4-byte word. The length is measured in 4-byte
141141 // words including padding, not bytes of actual string.
142 return (s.size() + 5) / 4;
142 return (s.size() / 4) + 1;
143143 }
144144
145145 void writeGCOVString(StringRef s) {
4848 }
4949
5050 static uint32_t length_of_string(const char *s) {
51 return (strlen(s) + 5) / 4;
51 return (strlen(s) / 4) + 1;
5252 }
5353
5454 static void write_string(const char *s) {