Skip to content

Commit

Permalink
Fix reading 32 bit gcov tag values on little-endian machines
Browse files Browse the repository at this point in the history
Summary:
The write buffer contains signed chars, which means the shift operations caused values such as the arc tag value (0x01a10000) to be read incorrectly (0xffa10000).

This fixes a regression from https://reviews.llvm.org/D49132.

Reviewers: uweigand, davidxl

Reviewed By: uweigand

Subscribers: llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D49161

llvm-svn: 336775
  • Loading branch information
marco-c committed Jul 11, 2018
1 parent df9d597 commit e21cfa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/GCDAProfiling.c
Expand Up @@ -79,7 +79,7 @@ static FILE *output_file = NULL;
* Buffer that we write things into.
*/
#define WRITE_BUFFER_SIZE (128 * 1024)
static char *write_buffer = NULL;
static unsigned char *write_buffer = NULL;
static uint64_t cur_buffer_size = 0;
static uint64_t cur_pos = 0;
static uint64_t file_size = 0;
Expand Down

0 comments on commit e21cfa7

Please sign in to comment.