1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

The computation of string length is not that complicated. Fix it, again. :)

llvm-svn: 130967
This commit is contained in:
Nick Lewycky 2011-05-05 23:52:18 +00:00
parent 37aa9169a8
commit eef7bead41
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ namespace {
// A GCOV string is a length, followed by a NUL, then between 0 and 3 NULs
// padding out to the next 4-byte word. The length is measured in 4-byte
// words including padding, not bytes of actual string.
return (s.size() + 5) / 4;
return (s.size() / 4) + 1;
}
void writeGCOVString(StringRef s) {

View File

@ -49,7 +49,7 @@ static void write_int64(uint64_t i) {
}
static uint32_t length_of_string(const char *s) {
return (strlen(s) + 5) / 4;
return (strlen(s) / 4) + 1;
}
static void write_string(const char *s) {