blob: dc83bb22b055ed53ce91ddc3cc6f75fd04d3e181 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/** bug-3766.c: a bug in an optimization resulted in a wrong type on a struct member of
another struct when passed as function parameter, resulting in a unbalanced stack
assertion being triggered in code generation when the two structs had different size,
*/
#include <testfwk.h>
typedef struct {
unsigned len;
} Buf;
typedef struct {
Buf name;
unsigned* dp; // Ensure that Search is bigger than Buf.
} Search;
int compareEntryName(Buf qName);
void lookupFunc(Search* s) {
compareEntryName(s->name); // Bug triggered on this line.
}
void
testBug (void)
{
Search s;
s.name.len = 0x55aa;
}
int compareEntryName (Buf qName)
{
ASSERT (qName.len == 0x55aa);
}
|