diff generator/dgenerator.cpp @ 393:1049b01aebd2

Fixed generator segfaults on OS X 10.6. Regarding the change to dgenerator.cpp, I am not actually sure if 0 is the correct value to pass, but it seems to work and the code which had been there before was just plain incorrect ? it read past the list boundaries.
author David Nadlinger <code@klickverbot.at>
date Sat, 28 Aug 2010 02:55:55 +0200
parents 7dddafad5a20
children
line wrap: on
line diff
--- a/generator/dgenerator.cpp	Sat Aug 28 02:17:15 2010 +0200
+++ b/generator/dgenerator.cpp	Sat Aug 28 02:55:55 2010 +0200
@@ -660,8 +660,10 @@
         referenceCounts = d_function->referenceCounts(d_function->implementingClass(),
                                                          i == 0 ? -1 : i);
 
-        foreach (ReferenceCount refCount, referenceCounts)
-            writeReferenceCount(s, refCount, i == 0 ? "this" : arguments.at(i-1)->argumentName(), arguments.at(i-1)->type());
+        foreach (ReferenceCount refCount, referenceCounts) {
+			// TODO: What is the correct value to pass as last parameter if (i == 0)?
+            writeReferenceCount(s, refCount, i == 0 ? "this" : arguments.at(i-1)->argumentName(), i == 0 ? 0 : arguments.at(i-1)->type());
+		}
     }
 
     referenceCounts = d_function->referenceCounts(d_function->implementingClass(), 0);