Open AGPX opened 5 days ago
Same issue here:
#include "common.h"
struct s
{
int value;
const char *string;
};
int main (void)
{
int i;
for (i = 0; i < 4; i++)
{
struct s *t = & (struct s) { 3, "hey there" };
if (t->value != 3)
abort();
t->value = 4;
if (t->value != 4)
abort();
}
exit (0);
}
The following test doesn't pass. Looks like that the struct with "hi" and 1, is created only once and recycled (optimization?) and so the second time
foo
is invoked, the t is 2. If you replace the functionbar
with the following, the test passes:Here the code:
with
common.h
: