aboutsummaryrefslogtreecommitdiff
path: root/include/tcclib.h
diff options
context:
space:
mode:
authorKirill Smelkov <kirr@navytux.spb.ru>2012-12-09 19:30:28 +0400
committerKirill Smelkov <kirr@navytux.spb.ru>2012-12-09 19:33:47 +0400
commitdbeb4faf21597914534c791f2ca63d3ed7427810 (patch)
treeb7c183220b27fa552db21e85ed9d50a675984bce /include/tcclib.h
parentefd9d92b7c5d88387709a891c54848f266f7fada (diff)
downloadtinycc-dbeb4faf21597914534c791f2ca63d3ed7427810.tar.gz
tinycc-dbeb4faf21597914534c791f2ca63d3ed7427810.tar.bz2
lib/bcheck: Fix code typo in __bound_delete_region()
We were calling get_page() with t2 index which is not correct, since get_page() operate on t1 indices. The bug is here from day-1, from 60f781c4 (first version of bounds checker) and show as a crash in __bound_delete_region() at program exit: $ ./tcc -B. -DTCC_TARGET_I386 -DCONFIG_MULTIARCHDIR=\"i386-linux-gnu\" -b -run -DONE_SOURCE \ ./tcc.c -B. -DTCC_TARGET_I386 -DCONFIG_MULTIARCHDIR=\"i386-linux-gnu\" -run -DONE_SOURCE \ ./tcc.c -B. -run tests/tcctest.c (lot's of correct output from tcctest) Runtime error: dereferencing invalid pointer at 0xa7c21cc4 __bound_delete_region() by (nil) ??? Segmentation fault The fix is simple - last page should be get through t1_end, like it is done in __bound_new_region(). After this patch, tcc is being able to compile itself with -b, then compile itself again and run tcctest with correct output. Tests follow.
Diffstat (limited to 'include/tcclib.h')
0 files changed, 0 insertions, 0 deletions