mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 21:21:14 +00:00
This was a nasty one to find as it was the unary expression rewrite that triggered the bug (by causing tighter if tests to be generated, which surprised me: I wasn't even trying for better if tests). I'm actually not sure why things worked at all, but this fixes the crashes and other weird behavior resulting from calls to performSelector. Two tests are included because I found a separate bug (not fixed yet, tested by calluse2) while getting the calluse test working.
23 lines
219 B
R
23 lines
219 B
R
id func (id self, SEL bar, ...)
|
|
{
|
|
return (id)1;
|
|
}
|
|
|
|
IMP get_func ()
|
|
{
|
|
return func;
|
|
}
|
|
|
|
id foo (IMP msg)
|
|
{
|
|
if (!(msg = get_func ())) {
|
|
return nil;
|
|
}
|
|
return msg(nil, nil);
|
|
}
|
|
|
|
int
|
|
main()
|
|
{
|
|
return foo (nil) == nil;
|
|
}
|