aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-06-06 17:54:24 -0400
committerXavier Raynaud2013-06-13 06:45:53 -0400
commitc0baa6628beb9e2e0b76ae5fb800540a97c6b286 (patch)
treee3fe7b3d0e6e91b0056acf65aef22073cecaffb0
parent713b79f7738cffda58dd99684231676fccdd9d9f (diff)
downloadorg.eclipse.linuxtools-c0baa6628beb9e2e0b76ae5fb800540a97c6b286.zip
org.eclipse.linuxtools-c0baa6628beb9e2e0b76ae5fb800540a97c6b286.tar.gz
org.eclipse.linuxtools-c0baa6628beb9e2e0b76ae5fb800540a97c6b286.tar.xz
Bug 401638 - Fix missing function tag error on valid gcda file.
Do not attempt to interpret the next four bytes of an unused level (tag labelled as zero) as the corresponding data length. These actually represent a seperate tag. Change-Id: I280e7efba01ff085aa4fc56b37d3959706077c40 Reviewed-on: https://git.eclipse.org/r/13628 Tested-by: Hudson CI Reviewed-by: Xavier Raynaud <xavier.raynaud@kalray.eu> IP-Clean: Xavier Raynaud <xavier.raynaud@kalray.eu>
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java
index 046cb17..aef541f 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java
@@ -83,6 +83,15 @@ public class GcdaRecordsParser {
try {
// parse header
int tag = stream.readInt();
+
+ /*
+ * Move on to the next tag if an unused level (tag == O) is encountered,
+ * these do no have corresponding data lengths.
+ */
+ if(tag == 0){
+ continue;
+ }
+
long length = (stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK);
// parse gcda data
switch (tag) {