[nemiver/follow-fork-mode: 15/35] Fix parsing empty asm instrs list.



commit eab2b4daca7aeeb6cf8fc635006fcd981d5aca2c
Author: Dodji Seketeli <dodji redhat com>
Date:   Sat Apr 10 21:57:16 2010 +0200

    Fix parsing empty asm instrs list.
    
    	* src/dbgengine/nmv-gdbmi-parser.cc
    	(GDBMIParser::parse_asm_instruction_list): Gently handle empty
    	asm instructions list.

 src/dbgengine/nmv-gdbmi-parser.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/dbgengine/nmv-gdbmi-parser.cc b/src/dbgengine/nmv-gdbmi-parser.cc
index 47b5271..8caa9b1 100644
--- a/src/dbgengine/nmv-gdbmi-parser.cc
+++ b/src/dbgengine/nmv-gdbmi-parser.cc
@@ -3924,6 +3924,14 @@ return false; \
         LOG_PARSING_ERROR2 (cur);
         return false;
     }
+    // If gdbmi_list is empty, gdbmi_list->content_type will yield
+    // GDBMIList::UNDEFINED_TYPE, so lets test it now and return early
+    // if necessary.
+    if (gdbmi_list->empty ()) {
+        a_to = cur;
+        a_asm_instrs.clear ();
+        return true;
+    }
     if (gdbmi_list->content_type () != GDBMIList::VALUE_TYPE) {
         LOG_PARSING_ERROR2 (cur);
         return false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]