Blob Blame History Raw
diff -ur kdebindings-4.5.2/generator/parser/rpp/pp-macro-expander.cpp kdebindings-4.5.2-generator-invalid-reads/generator/parser/rpp/pp-macro-expander.cpp
--- kdebindings-4.5.2/generator/parser/rpp/pp-macro-expander.cpp	2009-12-31 14:35:20.000000000 +0100
+++ kdebindings-4.5.2-generator-invalid-reads/generator/parser/rpp/pp-macro-expander.cpp	2010-10-07 17:10:57.000000000 +0200
@@ -268,10 +268,10 @@
         output << '\"';
 
         while (!is.atEnd()) {
-          if (input == '"') {
+          if (is == '"') {
             output << '\\' << is;
 
-          } else if (input == '\n') {
+          } else if (is == '\n') {
             output << '"' << is << '"';
 
           } else {
@@ -338,7 +338,7 @@
             
             skip_blanks(input, devnull());
             //Omit paste tokens behind empty used actuals, else we will merge with the previous text
-            if(input == '#' && (++input) == '#') {
+            if(!input.atEnd() && input == '#' && !(++input).atEnd() && input == '#') {
               ++input;
               //We have skipped a paste token
             }else{
diff -ur kdebindings-4.5.2/generator/type_compiler.cpp kdebindings-4.5.2-generator-invalid-reads/generator/type_compiler.cpp
--- kdebindings-4.5.2/generator/type_compiler.cpp	2010-04-28 10:00:56.000000000 +0200
+++ kdebindings-4.5.2-generator-invalid-reads/generator/type_compiler.cpp	2010-10-07 17:11:33.000000000 +0200
@@ -182,7 +182,7 @@
     TypeCompiler tc(m_session, m_visitor);
     tc.run(node->type_specifier, node->declarator);
     NameCompiler name_cc(m_session, m_visitor);
-    if (tc.type().isFunctionPointer())
+    if (tc.type().isFunctionPointer() && node->declarator && node->declarator->sub_declarator)
         name_cc.run(node->declarator->sub_declarator->id);
     else if (node->declarator)
         name_cc.run(node->declarator->id);