diff ir/irtypestruct.cpp @ 1574:72f00d740665

Fix bug #356. Our sorting function was wrong if a value was between two NULL pointers.
author Benjamin Kramer <benny.kra@gmail.com>
date Sat, 22 Aug 2009 11:45:20 +0200
parents 8d086d552909
children 8c37dcd7cfde
line wrap: on
line diff
--- a/ir/irtypestruct.cpp	Mon Aug 17 13:42:19 2009 -0600
+++ b/ir/irtypestruct.cpp	Sat Aug 22 11:45:20 2009 +0200
@@ -67,8 +67,8 @@
 {
     if (v1 && v2)
         return v1->offset < v2->offset;
-    else
-        return false;
+    // sort NULL pointers towards the end
+    return v1 && !v2;
 }
 
 // this is pretty much the exact same thing we need to do for fields in each