tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] bound checking for local variables


From: Sergey Korshunoff
Subject: Re: [Tinycc-devel] bound checking for local variables
Date: Sun, 29 Mar 2015 07:11:57 +0300

Hi! A problem with __bound_local_new is caused by compiling a bcheck.c
by tcc. A tcc doesn't handle __attribyte__((regparm(3))). and simply
ignore this. Look:

08048465 <main>:
 8048465:       55                      push   %ebp
 8048466:       89 e5                   mov    %esp,%ebp
 8048468:       81 ec 30 00 00 00       sub    $0x30,%esp
 804846e:       b8 00 9f 04 08          mov    $0x8049f00,%eax
 8048473:       e8 0b 07 00 00          call   8048b83 <__bound_local_new>

08048b83 <__bound_local_new>:
 8048b83:       55                      push   %ebp
 8048b84:       89 e5                   mov    %esp,%ebp
 8048b86:       81 ec 10 00 00 00       sub    $0x10,%esp
 8048b8c:       8b 45 08                mov    0x8(%ebp),%eax   ###
?????????????

After compiling bcheck.c by gcc we have the following output of the
test program:
fantoo TEST # ./a.out
bcheck.c, __bound_init() start
bcheck.c, __bound_new_region(0x804b144, c) start
bcheck.c, __bound_new_region end
bcheck.c, __bound_new_region(0x804b151, 1a) start
bcheck.c, __bound_new_region end
lbaound: start=ffffffd4 size=28

bcheck.c, __bound_init() end

bcheck.c, __bound_local_new start p1=8049d80 *p1=ffffffd4
bcheck.c, __bound_new_region(0xbfd56d3c, 28) start
bcheck.c, __bound_new_region end
bcheck.c, __bound_local_new end
add: 0xbfd56d3c 0
Ошибка сегментирования

This is much better.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]