Fix gawk miscompile
See testcase. Function pointer use was hosed when the destination function wasn't also called normally by the program.
This commit is contained in:
@ -8,9 +8,13 @@ int fred(int p)
|
||||
|
||||
int (*f)(int) = &fred;
|
||||
|
||||
/* To test what this is supposed to test the destination function
|
||||
(fprint here) must not be called directly anywhere in the test. */
|
||||
int (*fprintfptr)(FILE *, const char *, ...) = &fprintf;
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("%d\n", (*f)(24));
|
||||
fprintfptr(stdout, "%d\n", (*f)(24));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user