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

[gcov] Don't error 'unexpected end of memory buffe'

This commit is contained in:
Fangrui Song 2020-06-03 22:05:15 -07:00
parent bc4d185797
commit b7f9cc057b
2 changed files with 4 additions and 3 deletions

View File

@ -57,7 +57,7 @@ bool GCOVFile::readGCNO(GCOVBuffer &buf) {
uint32_t tag, length;
GCOVFunction *fn;
while (buf.readInt(tag) && tag) {
while ((tag = buf.getWord())) {
if (!buf.readInt(length))
return false;
if (tag == GCOV_TAG_FUNCTION) {
@ -163,7 +163,7 @@ bool GCOVFile::readGCDA(GCOVBuffer &buf) {
uint32_t dummy, tag, length;
uint32_t ident;
GCOVFunction *fn = nullptr;
while (buf.readInt(tag) && tag) {
while ((tag = buf.getWord())) {
if (!buf.readInt(length))
return false;
uint32_t pos = buf.cursor.tell();

View File

@ -11,9 +11,10 @@ RUN: cd %t
RUN: cp %p/Inputs/test* .
# Basic behaviour with no flags
RUN: llvm-cov gcov test.c | FileCheck %s --check-prefixes=OUT,OUTFILE --match-full-lines --strict-whitespace
RUN: llvm-cov gcov test.c 2> %t.err | FileCheck %s --check-prefixes=OUT,OUTFILE --match-full-lines --strict-whitespace
RUN: FileCheck %s --check-prefix=C --match-full-lines --strict-whitespace < test.cpp.gcov
RUN: diff -aub test_no_options.h.gcov test.h.gcov
RUN: count 0 < %t.err
# Same, but specifying the object directory
RUN: mkdir -p %t/objdir