[gobject-introspection] cmph/bdz.c: Work Around MSVC 2012 x64 Compiler Bug



commit 8d651e4d90377e71c3804032e33f6f6d97587d8b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jul 23 15:36:41 2014 +0800

    cmph/bdz.c: Work Around MSVC 2012 x64 Compiler Bug
    
    Due to an MSVC 2012 x64 compiler issue, the compiler generates bad code
    for bdz.c, so the for loop in assign() continues running until the point
    i falls below zero, causing an access violation when we try to do
    curr_edge=queue[i]; (line 427 in bdz.c).  Address this issue by breaking
    out of the loop at the end of it when i reaches 0 after doing the
    necessary processing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733595

 girepository/cmph/bdz.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/girepository/cmph/bdz.c b/girepository/cmph/bdz.c
index 81cd715..a1c907f 100644
--- a/girepository/cmph/bdz.c
+++ b/girepository/cmph/bdz.c
@@ -455,6 +455,12 @@ static void assigning(bdz_config_data_t *bdz, bdz_graph3_t* graph3, bdz_queue_t
                        SETBIT(marked_vertices, v2);
                }               
                DEBUGP("A:%u %u %u -- %u %u %u\n", v0, v1, v2, GETVALUE(bdz->g, v0), GETVALUE(bdz->g, v1), 
GETVALUE(bdz->g, v2));
+#if (_MSC_VER > 1699 && _MSC_VER < 1800)
+    /* This is bad, MSVC 2012 X64 getting confused with the value of i... */
+    /* an obvious MSVC 2012 X64 compiler bug :| */
+    if (i <= 0)
+      break;
+#endif
        };
        free(marked_vertices);
 }


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