annotate gcc/testsuite/gcc.c-torture/compile/pr52306.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR middle-end/52306 */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 struct xmlNs {
kono
parents:
diff changeset
4 const unsigned char *prefix;
kono
parents:
diff changeset
5 };
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct xmlNode {
kono
parents:
diff changeset
8 const unsigned char *name;
kono
parents:
diff changeset
9 struct xmlNs *ns;
kono
parents:
diff changeset
10 struct xmlNs *nsDef;
kono
parents:
diff changeset
11 };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 struct xsltTemplate {
kono
parents:
diff changeset
14 const unsigned char *name;
kono
parents:
diff changeset
15 int inheritedNsNr;
kono
parents:
diff changeset
16 void *inheritedNs;
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 struct xsltTemplate *xsltNewTemplate(void);
kono
parents:
diff changeset
20 void xsltGetQNameURI(unsigned char**);
kono
parents:
diff changeset
21 long xmlMalloc(unsigned long);
kono
parents:
diff changeset
22 void xsltGenericDebug(void);
kono
parents:
diff changeset
23 int xmlStrEqual(const unsigned char*, const unsigned char*);
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 static void xsltGetInheritedNsList(
kono
parents:
diff changeset
26 struct xsltTemplate *template,
kono
parents:
diff changeset
27 struct xmlNode *node)
kono
parents:
diff changeset
28 {
kono
parents:
diff changeset
29 struct xmlNs *cur;
kono
parents:
diff changeset
30 struct xmlNs **ret;
kono
parents:
diff changeset
31 int nbns = 0;
kono
parents:
diff changeset
32 int maxns = 10;
kono
parents:
diff changeset
33 int i;
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 if (template == 0
kono
parents:
diff changeset
36 || template->inheritedNsNr != 0
kono
parents:
diff changeset
37 || template->inheritedNs != 0)
kono
parents:
diff changeset
38 return;
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 while (node != 0) {
kono
parents:
diff changeset
41 cur = node->nsDef;
kono
parents:
diff changeset
42 ret = (struct xmlNs**) xmlMalloc((maxns + 1) * sizeof(struct xmlNs*));
kono
parents:
diff changeset
43 for (i = 0; i < nbns; i++)
kono
parents:
diff changeset
44 if (cur->prefix == ret[i]->prefix
kono
parents:
diff changeset
45 || xmlStrEqual(cur->prefix, 0))
kono
parents:
diff changeset
46 break;
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 if (i >= nbns) {
kono
parents:
diff changeset
49 if (nbns >= maxns)
kono
parents:
diff changeset
50 return;
kono
parents:
diff changeset
51 ret[nbns++] = cur;
kono
parents:
diff changeset
52 }
kono
parents:
diff changeset
53 }
kono
parents:
diff changeset
54 }
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 static void
kono
parents:
diff changeset
57 xsltParseStylesheetTemplate(struct xmlNode *template)
kono
parents:
diff changeset
58 {
kono
parents:
diff changeset
59 struct xsltTemplate *ret;
kono
parents:
diff changeset
60 unsigned char *prop;
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 ret = xsltNewTemplate();
kono
parents:
diff changeset
63 if (ret == 0)
kono
parents:
diff changeset
64 return;
kono
parents:
diff changeset
65 xsltGetInheritedNsList(ret, template);
kono
parents:
diff changeset
66 xsltGenericDebug();
kono
parents:
diff changeset
67 xsltGetQNameURI(&prop);
kono
parents:
diff changeset
68 xmlStrEqual(0, ret->name);
kono
parents:
diff changeset
69 }
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 void xsltParseStylesheetTop(struct xmlNode *cur)
kono
parents:
diff changeset
72 {
kono
parents:
diff changeset
73 xmlStrEqual(0, 0);
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 while (cur != 0) {
kono
parents:
diff changeset
76 if (xmlStrEqual(cur->name, 0))
kono
parents:
diff changeset
77 ;
kono
parents:
diff changeset
78 else if (xmlStrEqual(cur->name, 0))
kono
parents:
diff changeset
79 ;
kono
parents:
diff changeset
80 else if (xmlStrEqual(cur->name, 0))
kono
parents:
diff changeset
81 xsltParseStylesheetTemplate(cur);
kono
parents:
diff changeset
82 }
kono
parents:
diff changeset
83 }
kono
parents:
diff changeset
84