https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329

--- Comment #48 from Kaz Kylheku <kkylheku at gmail dot com> ---
(In reply to Thomas Koenig from comment #47)
> I see two problems with this suggestion, one minor and one major.
> 
> First, there may well be a value > 1 on the stack for a regular
> call, see comment #15.

Thus it adds overhead to cases like when "ab" is passed, where the callee
treats that as a length 1 string. It has to be suspicious of the value 2 and go
through the self-calling hoop.

(Oh well; obviously this is a workaround that would have to go through
deprecation and removal.)

> Second, the value 1 may end up being there by accident, then this

That I clearly understand: a value 1 may be there spuriously even if no
argument was passed.

> method would cause a crash, and this would be even harder to debug
> than the original case.

That's the thing I'm keenly curious about: if that value is fortuitously the
right one, in the right place on the stack, where is the crash?

(Of course, we must not mutate that word; it belongs to the C caller's frame.)

Reply via email to