]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Better failed assertion then silent data corruption
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Fri, 4 Feb 2011 19:55:25 +0000 (19:55 +0000)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Fri, 4 Feb 2011 19:55:25 +0000 (19:55 +0000)
This is part 1 of the fix to bug 246152, and makes the bug
reproducable as failed assertion also on Ubuntu 10.10 on 64bit
machines. However, the test needs to be compiled 32bit (-m32).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11523

callgrind/jumps.c

index fc306af0d562b6caf1a7e812148ef5e8b126b7fa..50b35af2a40fa8e872e8f95f56ae189e089cd7bd 100644 (file)
@@ -160,6 +160,8 @@ static jCC* new_jcc(BBCC* from, UInt jmp, BBCC* to)
     * This list is only used at dumping time */
 
    if (from) {
+       /* Prohibit corruption by array overrun */
+       CLG_ASSERT((0 <= jmp) && (jmp <= from->bb->cjmp_count));
        jcc->next_from = from->jmp[jmp].jcc_list;
        from->jmp[jmp].jcc_list = jcc;
    }