From eca809f540288cedd887dc8ef7ed191030b884b0 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Tue, 10 Nov 2009 02:50:44 -0800 Subject: Fix off by 1 error in _select_ds_mutations This bug resulted in a crash, but only with -O2 and only on x86_64. Finding this bug turned out to require two hours of staring at gdb disassembly output and tracking the values of registers, since info locals didn't work. I think my hacker level just went up. --- crawl-ref/source/mutation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crawl-ref/source/mutation.cc') diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 565bdbad9e..8aaf5460d3 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -2855,7 +2855,7 @@ try_again: std::set facets_used; - for (int tier = ARRAYSZ(ct_of_tier); tier >= 0; --tier) + for (int tier = ARRAYSZ(ct_of_tier) - 1; tier >= 0; --tier) { for (int nfacet = 0; nfacet < ct_of_tier[tier]; ++nfacet) { -- cgit v1.2.3-54-g00ecf