From 8d651e4d90377e71c3804032e33f6f6d97587d8b Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 23 Jul 2014 15:36:41 +0800 Subject: 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 file changed, 6 insertions(+) diff --git a/girepository/cmph/bdz.c b/girepository/cmph/bdz.c index 81cd7151..a1c907f1 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); } -- cgit v1.2.1