[nemiver] Fix parsing empty asm instrs list.



commit 516197fc024d3f0b82ed2e54815349e6acc6c763
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 a351799..06ce84b 100644
--- a/src/dbgengine/nmv-gdbmi-parser.cc
+++ b/src/dbgengine/nmv-gdbmi-parser.cc
@@ -3964,6 +3964,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]