]> git.wh0rd.org - ICEs.git/blob - 571482/jsxml.ii.9
more
[ICEs.git] / 571482 / jsxml.ii.9
1 typedef union {
2 long int asBits;
3 } jsval_layout;
4 static jsval_layout STRING_TO_JSVAL_IMPL()
5 {
6 }
7
8 typedef __attribute__ ((aligned(8)))
9 long int jsval;
10 class Value {
11 public:void setString()
12 {
13 data = STRING_TO_JSVAL_IMPL();
14 } jsval_layout data;
15 }
16
17 __attribute__ ((aligned(8)));
18 static Value StringValue()
19 {
20 Value v;
21 v.setString();
22 return v;
23 }
24
25 static const jsval & Jsvalify(const Value & v)
26 {
27 return (const jsval &)v;
28 }
29
30 static Value *Valueify(jsval * v)
31 {
32 return (Value *)v;
33 }
34
35 struct JSObject {
36 void getQNameLocalName();
37 };
38 static Value IdToValue(int id)
39 {
40 if (id)
41 return StringValue();
42 }
43
44 static jsval IdToJsval(int id)
45 {
46 return Jsvalify(IdToValue(id));
47 }
48
49 class AutoGCRooter;
50 struct JSContext {
51 AutoGCRooter *autoGCRooters;
52 };
53 class AutoGCRooter {
54 public:
55 AutoGCRooter(JSContext *cx)
56 {
57 }
58 };
59
60 class AutoArrayRooter : AutoGCRooter {
61 public:AutoArrayRooter(JSContext *cx, Value *vec):
62 AutoGCRooter(cx)
63 {
64 array = vec;
65 cx->autoGCRooters = this;
66 }
67 Value *array;
68 };
69
70 static void PutProperty(JSContext * cx, int id, jsval * vp)
71 {
72 JSObject *nameobj;
73 jsval roots[3];
74 roots[1] = IdToJsval(id);
75 roots[2] = *vp;
76 AutoArrayRooter tvr(cx, Valueify(roots));
77 nameobj->getQNameLocalName();
78 }
79
80 void xml_defineProperty(JSContext * cx, int id, const Value * v)
81 {
82 jsval tmp = Jsvalify(*v);
83 PutProperty(cx, id, &tmp);
84 }