quakeforge/tools/qfcc/test/calluse2.r
Bill Currie 13f25af881 [qfcc] Use the called function for ruamoko progs
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.
2024-11-18 03:42:26 +09:00

23 lines
213 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);
}