]> git.wh0rd.org - ICEs.git/blobdiff - 571482/jsxml.ii.2
more
[ICEs.git] / 571482 / jsxml.ii.2
diff --git a/571482/jsxml.ii.2 b/571482/jsxml.ii.2
new file mode 100644 (file)
index 0000000..93b9675
--- /dev/null
@@ -0,0 +1,425 @@
+typedef long unsigned int size_t;
+extern "C" {
+       extern "C" {
+               typedef union {
+               } pthread_barrierattr_t;
+}} typedef long int ptrdiff_t;
+typedef unsigned int uint32_t;
+typedef unsigned long int uint64_t;
+typedef uint32_t JSUint32;
+typedef uint64_t JSUint64;
+extern "C" {
+       typedef int JSIntn;
+       typedef unsigned int JSUintn;
+       typedef JSIntn JSBool;
+       typedef JSUint64 uint64;
+       typedef JSUint32 uint32;
+} typedef JSUintn uintN;
+extern "C" {
+       typedef struct {
+       } _IO_cookie_io_functions_t;
+       typedef struct JSString JSString;
+       typedef struct JSObject JSObject;
+       typedef union jsval_layout {
+               uint64 asBits;
+       } jsval_layout;
+       static
+           __attribute__ ((always_inline)) inline jsval_layout
+           STRING_TO_JSVAL_IMPL(JSString * str) {
+       } typedef __attribute__ ((aligned(8))) uint64 jsval;
+       typedef ptrdiff_t jsid;
+       typedef JSUint32 jsuint;
+       typedef enum JSType {
+               JSTYPE_VOID, JSTYPE_OBJECT, JSTYPE_FUNCTION, JSTYPE_STRING,
+                   JSTYPE_NUMBER, JSTYPE_BOOLEAN, JSTYPE_NULL, JSTYPE_XML,
+                   JSTYPE_LIMIT
+       } JSType;
+       typedef enum JSProtoKey {
+               JSProto_Null = 0, JSProto_Object = 1, JSProto_Function =
+                   2, JSProto_Array = 3, JSProto_Boolean = 4, JSProto_JSON =
+                   5, JSProto_Date = 6, JSProto_Math = 7, JSProto_Number =
+                   8, JSProto_String = 9, JSProto_RegExp = 10, JSProto_XML =
+                   11, JSProto_Namespace = 12, JSProto_QName =
+                   13, JSProto_Reflect = 14, JSProto_ASTNode =
+                   15, JSProto_Error = 16, JSProto_InternalError =
+                   17, JSProto_EvalError = 18, JSProto_RangeError =
+                   19, JSProto_ReferenceError = 20, JSProto_SyntaxError =
+                   21, JSProto_TypeError = 22, JSProto_URIError =
+                   23, JSProto_Generator = 24, JSProto_Iterator =
+                   25, JSProto_StopIteration = 26, JSProto_ArrayBuffer =
+                   27, JSProto_Int8Array = 28, JSProto_Uint8Array =
+                   29, JSProto_Int16Array = 30, JSProto_Uint16Array =
+                   31, JSProto_Int32Array = 32, JSProto_Uint32Array =
+                   33, JSProto_Float32Array = 34, JSProto_Float64Array =
+                   35, JSProto_Uint8ClampedArray = 36, JSProto_Proxy =
+                   37, JSProto_AnyName = 38, JSProto_LIMIT
+       } JSProtoKey;
+       typedef enum JSAccessMode {
+               JSACC_PROTO = 0, JSACC_PARENT = 1, JSACC_WATCH = 3, JSACC_READ =
+                   4, JSACC_WRITE = 8, JSACC_LIMIT
+       } JSIterateOp;
+       typedef struct JSContext JSContext;
+       typedef struct JSTracer JSTracer;
+       typedef struct JSXDRState JSXDRState;
+       typedef JSBool(*JSEnumerateOp) (JSContext * cx, JSObject * obj);
+       typedef JSBool(*JSResolveOp) (JSContext * cx, JSObject * obj, jsid id);
+       typedef void (*JSFinalizeOp) (JSContext * cx, JSObject * obj);
+       typedef JSBool(*JSXDRObjectOp) (JSXDRState * xdr, JSObject ** objp);
+       typedef uint32(*JSMarkOp) (JSContext * cx, JSObject * obj, void *arg);
+       static
+           __attribute__ ((always_inline)) inline JSBool JSID_IS_STRING(jsid
+                                                                        iden) {
+       }
+       static
+           __attribute__ ((always_inline)) inline JSString *JSID_TO_STRING(jsid
+                                                                           iden)
+       {
+       }
+       typedef void (*JSClassInternal) ();
+       extern
+           __attribute__ ((visibility("default"))) JSBool
+           JS_PropertyStub(JSContext * cx, JSObject * obj, jsid id,
+                           jsval * vp);
+       extern
+           __attribute__ ((visibility("default"))) JSBool
+           JS_StrictPropertyStub(JSContext * cx, JSObject * obj, jsid id,
+                                 JSBool strict, jsval * vp);
+       extern
+           __attribute__ ((visibility("default"))) JSBool
+           JS_EnumerateStub(JSContext * cx, JSObject * obj);
+       extern
+           __attribute__ ((visibility("default"))) JSBool
+           JS_ResolveStub(JSContext * cx, JSObject * obj, jsid id);
+       extern
+           __attribute__ ((visibility("default"))) JSBool
+           JS_ConvertStub(JSContext * cx, JSObject * obj, JSType type,
+                          jsval * vp);
+       extern
+           __attribute__ ((visibility("default"))) void
+           JS_FinalizeStub(JSContext * cx, JSObject * obj);
+       typedef struct JSProperty JSProperty;
+       typedef struct JSLinearString JSLinearString;
+       typedef JSObject *(*JSObjectOp) (JSContext * cx, JSObject * obj);
+       typedef JSObject *(*JSIteratorOp) (JSContext * cx, JSObject * obj,
+                                          JSBool keysonly);
+}
+
+namespace js {
+       class Value {
+             public:__attribute__ ((always_inline)) inline void setNull()
+               {
+               } __attribute__ ((always_inline)) inline void setString(JSString
+                                                                       * str) {
+                       data = STRING_TO_JSVAL_IMPL(str);
+               } jsval_layout data;
+       }
+       __attribute__ ((aligned(8)));
+       static __attribute__ ((always_inline)) inline Value UndefinedValue() {
+       }
+       static
+           __attribute__ ((always_inline)) inline Value StringValue(JSString *
+                                                                    str) {
+               Value v;
+               v.setString(str);
+               return v;
+       }
+       static inline const jsval & Jsvalify(const Value & v) {
+               return (const jsval &)v;
+       }
+       static inline Value *Valueify(jsval * v) {
+               return (Value *) v;
+       }
+       typedef JSBool(*Native) (JSContext * cx, uintN argc, Value * vp);
+       typedef JSBool(*PropertyOp) (JSContext * cx, JSObject * obj, jsid id,
+                                    Value * vp);
+       typedef JSBool(*StrictPropertyOp) (JSContext * cx, JSObject * obj,
+                                          jsid id, JSBool strict, Value * vp);
+       typedef JSBool(*ConvertOp) (JSContext * cx, JSObject * obj, JSType type,
+                                   Value * vp);
+       typedef JSBool(*NewEnumerateOp) (JSContext * cx, JSObject * obj,
+                                        JSIterateOp enum_op, Value * statep,
+                                        jsid * idp);
+       typedef JSBool(*HasInstanceOp) (JSContext * cx, JSObject * obj,
+                                       const Value * v, JSBool * bp);
+       typedef JSBool(*CheckAccessOp) (JSContext * cx, JSObject * obj, jsid id,
+                                       JSAccessMode mode, Value * vp);
+       typedef JSBool(*EqualityOp) (JSContext * cx, JSObject * obj,
+                                    const Value * v, JSBool * bp);
+       typedef JSBool(*DefinePropOp) (JSContext * cx, JSObject * obj, jsid id,
+                                      const Value * value, PropertyOp getter,
+                                      StrictPropertyOp setter, uintN attrs);
+       typedef JSBool(*PropertyIdOp) (JSContext * cx, JSObject * obj,
+                                      JSObject * receiver, jsid id,
+                                      Value * vp);
+       typedef JSBool(*StrictPropertyIdOp) (JSContext * cx, JSObject * obj,
+                                            jsid id, Value * vp,
+                                            JSBool strict);
+       typedef JSBool(*DeleteIdOp) (JSContext * cx, JSObject * obj, jsid id,
+                                    Value * vp, JSBool strict);
+       typedef JSBool(*LookupPropOp) (JSContext * cx, JSObject * obj, jsid id,
+                                      JSObject ** objp, JSProperty ** propp);
+       typedef JSBool(*AttributesOp) (JSContext * cx, JSObject * obj, jsid id,
+                                      uintN * attrsp);
+       typedef JSType(*TypeOfOp) (JSContext * cx, JSObject * obj);
+       typedef void (*TraceOp) (JSTracer * trc, JSObject * obj);
+       typedef JSObject *(*ObjectOp) (JSContext * cx, JSObject * obj);
+       typedef void (*FinalizeOp) (JSContext * cx, JSObject * obj);
+       class AutoIdVector;
+       typedef JSBool(*FixOp) (JSContext * cx, JSObject * obj, bool * fixed,
+                               AutoIdVector * props);
+       static const PropertyOp PropertyStub = (PropertyOp) JS_PropertyStub;
+       static const StrictPropertyOp StrictPropertyStub =
+           (StrictPropertyOp) JS_StrictPropertyStub;
+       static const JSEnumerateOp EnumerateStub = JS_EnumerateStub;
+       static const JSResolveOp ResolveStub = JS_ResolveStub;
+       static const ConvertOp ConvertStub = (ConvertOp) JS_ConvertStub;
+       static const JSFinalizeOp FinalizeStub = JS_FinalizeStub;
+       struct ClassExtension {
+               EqualityOp equality;
+               JSObjectOp outerObject;
+               JSObjectOp innerObject;
+               JSIteratorOp iteratorObject;
+               void *unused;
+       };
+       struct ObjectOps {
+               js::LookupPropOp lookupProperty;
+               js::DefinePropOp defineProperty;
+               js::PropertyIdOp getProperty;
+               js::StrictPropertyIdOp setProperty;
+               js::AttributesOp getAttributes;
+               js::AttributesOp setAttributes;
+               js::DeleteIdOp deleteProperty;
+               js::NewEnumerateOp enumerate;
+               js::TypeOfOp typeOf;
+               js::TraceOp trace;
+               js::FixOp fix;
+               js::ObjectOp thisObject;
+               js::FinalizeOp clear;
+       };
+       struct Class {
+               const char *name;
+               uint32 flags;
+               PropertyOp addProperty;
+               PropertyOp delProperty;
+               PropertyOp getProperty;
+               StrictPropertyOp setProperty;
+               JSEnumerateOp enumerate;
+               JSResolveOp resolve;
+               ConvertOp convert;
+               JSFinalizeOp finalize;
+               JSClassInternal reserved0;
+               CheckAccessOp checkAccess;
+               Native call;
+               Native construct;
+               JSXDRObjectOp xdrObject;
+               HasInstanceOp hasInstance;
+               JSMarkOp mark;
+               ClassExtension ext;
+               ObjectOps ops;
+       };
+       namespace gc {
+               struct Cell {
+               };
+}} struct JSObject:js::gc::Cell {
+       js::Class * getClass() const {
+       } static const uint32 QNAME_CLASS_RESERVED_SLOTS = 3;
+       inline JSLinearString *getNamePrefix() const;
+       inline JSLinearString *getNameURI() const;
+       inline JSLinearString *getQNameLocalName() const;
+};
+namespace js {
+       static __attribute__ ((always_inline)) inline Value IdToValue(jsid id) {
+               if (JSID_IS_STRING(id))
+                       return StringValue(JSID_TO_STRING(id));
+       } static __attribute__ ((always_inline)) inline jsval IdToJsval(jsid id) {
+               return Jsvalify(IdToValue(id));
+       }
+}
+
+extern const char js_XML_str[];
+extern const char js_AnyName_str[];
+inline JSBool js_IdIsIndex(jsid id, jsuint * indexp)
+{
+}
+
+namespace js {
+       class AutoGCRooter;
+} struct JSContext {
+       js::AutoGCRooter * autoGCRooters;
+};
+namespace js {
+       class AutoGCRooter {
+             public:AutoGCRooter(JSContext * cx,
+                            ptrdiff_t tag):down(cx->autoGCRooters), tag(tag),
+                   context(cx) {
+                       cx->autoGCRooters = this;
+             } protected:AutoGCRooter * const down;
+               ptrdiff_t tag;
+               JSContext *const context;
+       };
+       class AutoArrayRooter:private AutoGCRooter {
+             public:AutoArrayRooter(JSContext * cx, size_t len,
+                               Value * vec):AutoGCRooter(cx, len),
+                   array(vec) {
+               } Value *array;
+      private:};
+}
+
+struct JSXMLArray {
+};
+struct JSXMLArrayCursor {
+};
+typedef enum JSXMLClass {
+       JSXML_CLASS_LIST, JSXML_CLASS_ELEMENT, JSXML_CLASS_ATTRIBUTE,
+           JSXML_CLASS_PROCESSING_INSTRUCTION, JSXML_CLASS_TEXT,
+           JSXML_CLASS_COMMENT, JSXML_CLASS_LIMIT
+} JSXMLElemVar;
+struct JSXML:js::gc::Cell {
+       uint32 xml_class;
+};
+namespace js {
+} using namespace js;
+__attribute__ ((visibility("default")))
+Class js_AttributeNameClass = {
+       js_AnyName_str,
+           (1 << 6) |
+           (((JSObject::QNAME_CLASS_RESERVED_SLOTS) & (((JSUint32) 1 << (8)) -
+                                                       1)) << 8) | (1 << ((8 +
+                                                                           8) +
+                                                                          3)) |
+           (1 << ((8 + 8) + 1)), PropertyStub, PropertyStub, PropertyStub,
+           StrictPropertyStub, EnumerateStub, ResolveStub, ConvertStub,
+           FinalizeStub
+};
+
+static JSObject *NewXMLAttributeName(JSContext * cx, JSLinearString * uri,
+                                    JSLinearString * prefix,
+                                    JSLinearString * localName)
+{
+}
+
+static JSBool GetXMLSettingFlags(JSContext * cx, uintN * flagsp)
+{
+       JSBool flag[4];
+       for (size_t n = 0; n < 4; ++n)
+               if (flag[n])
+                       *flagsp |= ((JSUint32) 1 << (n));
+}
+
+static JSBool PutProperty(JSContext * cx, JSObject * obj, jsid id,
+                         JSBool strict, jsval * vp)
+{
+       enum {
+               OBJ_ROOT, ID_ROOT, VAL_ROOT
+       };
+       JSXML *xml, *vxml, *rxml, *kid, *attr, *parent, *copy, *kid2, *match;
+       JSObject *vobj, *nameobj, *attrobj, *parentobj, *kidobj, *copyobj;
+       uint32 index, i, j, k, n, q, matchIndex;
+       jsval roots[3];
+       roots[ID_ROOT] = IdToJsval(id);
+       roots[VAL_ROOT] = *vp;
+       AutoArrayRooter tvr(cx, (sizeof(roots) / sizeof(roots)[0]),
+                           Valueify(roots));
+       if (js_IdIsIndex(id, &index)) {
+               if (kid->xml_class == JSXML_CLASS_ATTRIBUTE) {
+                       if (nameobj->getClass() != &js_AttributeNameClass) {
+                               nameobj =
+                                   NewXMLAttributeName(cx,
+                                                       nameobj->getNameURI(),
+                                                       nameobj->
+                                                       getNamePrefix(),
+                                                       nameobj->
+                                                       getQNameLocalName());
+                       }
+               }
+       }
+}
+
+static void xml_finalize(JSContext * cx, JSObject * obj)
+{
+}
+
+static JSBool xml_lookupProperty(JSContext * cx, JSObject * obj, jsid id,
+                                JSObject ** objp, JSProperty ** propp)
+{
+}
+
+static JSBool xml_defineProperty(JSContext * cx, JSObject * obj, jsid id,
+                                const Value * v, PropertyOp getter,
+                                StrictPropertyOp setter, uintN attrs)
+{
+       jsval tmp = Jsvalify(*v);
+       return PutProperty(cx, obj, id, false, &tmp);
+}
+
+static JSBool xml_getProperty(JSContext * cx, JSObject * obj,
+                             JSObject * receiver, jsid id, Value * vp)
+{
+}
+
+static JSBool xml_setProperty(JSContext * cx, JSObject * obj, jsid id,
+                             Value * vp, JSBool strict)
+{
+}
+
+static JSBool xml_getAttributes(JSContext * cx, JSObject * obj, jsid id,
+                               uintN * attrsp)
+{
+}
+
+static JSBool xml_setAttributes(JSContext * cx, JSObject * obj, jsid id,
+                               uintN * attrsp)
+{
+}
+
+static JSBool xml_deleteProperty(JSContext * cx, JSObject * obj, jsid id,
+                                Value * rval, JSBool strict)
+{
+}
+
+JSBool xml_convert(JSContext * cx, JSObject * obj, JSType type, Value * rval)
+{
+}
+
+static JSBool xml_enumerate(JSContext * cx, JSObject * obj, JSIterateOp enum_op,
+                           Value * statep, jsid * idp)
+{
+}
+
+static JSType xml_typeOf(JSContext * cx, JSObject * obj)
+{
+}
+
+static JSBool xml_hasInstance(JSContext * cx, JSObject * obj, const Value *,
+                             JSBool * bp)
+{
+}
+
+static void xml_trace(JSTracer * trc, JSObject * obj)
+{
+}
+
+static JSBool xml_fix(JSContext * cx, JSObject * obj, bool * success,
+                     AutoIdVector * props)
+{
+}
+
+static void xml_clear(JSContext * cx, JSObject * obj)
+{
+}
+
+__attribute__ ((visibility("default")))
+Class js_XMLClass = {
+       js_XML_str,
+           (1 << 0) | (1 << ((8 + 8) + 3)) | ((JSProto_XML) << ((8 + 8) + 8)),
+           PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
+           EnumerateStub, ResolveStub, xml_convert, xml_finalize, __null,
+           __null, __null, __null, __null, xml_hasInstance,
+           ((JSMarkOp) (xml_trace)), {
+                                      __null, __null, __null, __null, __null}
+       , {
+          xml_lookupProperty, xml_defineProperty, xml_getProperty,
+          xml_setProperty, xml_getAttributes, xml_setAttributes,
+          xml_deleteProperty, xml_enumerate, xml_typeOf, __null, xml_fix,
+          __null, xml_clear}
+};