On Tuesday 16 September 2008 14:47:58 NotFound wrote:

> > It certainly shouldn't segfault. But, the question is: why does it
> > segfault at 206 parameters? Throwing an exception to avoid an error we
> > don't understand isn't good for the long-term health of the VM.
>
> The problem is located inside compilers/imcc/pcc.c:pcc_get_args function.
>
> It has the comment /* XXX check avail len */ just at the point where
> the segfault happens. char buf[1024] is the variable overrunned.

That sounds like a bog-standard static variable overflow, where each parameter 
requires five bytes of storage.  If that's a good rule of thumb, we could 
malloc/free that buffer instead, and then beat anyone who uses more than a 
dozen parameters.

-- c

Reply via email to