aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-06-06 17:54:24 (EDT)
committerXavier Raynaud2013-06-27 05:34:56 (EDT)
commitf426f0a28a795e45a71888240819b8530b4facf0 (patch)
tree382998dc6d69e5c7865ab14f3dc01945944b111c
parent2aa4892cece1fc393f8bec3083a6303912d17f16 (diff)
downloadorg.eclipse.linuxtools-f426f0a28a795e45a71888240819b8530b4facf0.zip
org.eclipse.linuxtools-f426f0a28a795e45a71888240819b8530b4facf0.tar.gz
org.eclipse.linuxtools-f426f0a28a795e45a71888240819b8530b4facf0.tar.bz2
Bug 401638 - Fix missing function tag error on valid gcda file.stable-2.0refs/changes/78/14078/2
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. This is cherry-pick from master reviewed here; https://git.eclipse.org/r/13628 Change-Id: Id5c1efa3f9aaf836e4f894829f2a362f13aa83f6 Reviewed-on: https://git.eclipse.org/r/14078 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) {