X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=571482%2Fjsxml.ii.9;fp=571482%2Fjsxml.ii.9;h=a5deaf2eaacc59d86e5a4c9bb37ae4cb3081bdd4;hp=0000000000000000000000000000000000000000;hb=bd3239d2bbe0de3a200b266503e3330b1e391489;hpb=dbff64cb4b7530861c2309c794efdd4e0cf47a23 diff --git a/571482/jsxml.ii.9 b/571482/jsxml.ii.9 new file mode 100644 index 0000000..a5deaf2 --- /dev/null +++ b/571482/jsxml.ii.9 @@ -0,0 +1,84 @@ +typedef union { + long int asBits; +} jsval_layout; +static jsval_layout STRING_TO_JSVAL_IMPL() +{ +} + +typedef __attribute__ ((aligned(8))) +long int jsval; +class Value { + public:void setString() +{ + data = STRING_TO_JSVAL_IMPL(); +} jsval_layout data; +} + +__attribute__ ((aligned(8))); +static Value StringValue() +{ + Value v; + v.setString(); + return v; +} + +static const jsval & Jsvalify(const Value & v) +{ + return (const jsval &)v; +} + +static Value *Valueify(jsval * v) +{ + return (Value *)v; +} + +struct JSObject { + void getQNameLocalName(); +}; +static Value IdToValue(int id) +{ + if (id) + return StringValue(); +} + +static jsval IdToJsval(int id) +{ + return Jsvalify(IdToValue(id)); +} + +class AutoGCRooter; +struct JSContext { + AutoGCRooter *autoGCRooters; +}; +class AutoGCRooter { + public: +AutoGCRooter(JSContext *cx) +{ + } +}; + +class AutoArrayRooter : AutoGCRooter { + public:AutoArrayRooter(JSContext *cx, Value *vec): +AutoGCRooter(cx) +{ +array = vec; +cx->autoGCRooters = this; + } + Value *array; +}; + +static void PutProperty(JSContext * cx, int id, jsval * vp) +{ + JSObject *nameobj; + jsval roots[3]; + roots[1] = IdToJsval(id); + roots[2] = *vp; + AutoArrayRooter tvr(cx, Valueify(roots)); + nameobj->getQNameLocalName(); +} + +void xml_defineProperty(JSContext * cx, int id, const Value * v) +{ + jsval tmp = Jsvalify(*v); + PutProperty(cx, id, &tmp); +}