[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[creduce-bugs] Couple of crashes
- Subject: [creduce-bugs] Couple of crashes
- From: markus at trippelsdorf.de (Markus Trippelsdorf)
- Date: Sat, 29 Jun 2013 11:52:38 +0200
1)
% gdb --args /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=param-to-local --counter=6 clang_delta_crash_tmp_fileBmJ6xQ.ii
Reading symbols from /var/tmp/creduce/clang_delta/clang_delta...done.
(gdb) run
Starting program: /var/tmp/creduce/clang_delta/clang_delta --transformation=param-to-local --counter=6 clang_delta_crash_tmp_fileBmJ6xQ.ii
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x0000000000a6fdee in Transformation::lookupFunctionDeclFromBases (this=this at entry=0x1604370, DName=..., CXXRD=CXXRD at entry=0x168efd0) at Transformation.cpp:505
505 const CXXRecordDecl *Base = getBaseDeclFromType(Ty);
(gdb) bt
#0 0x0000000000a6fdee in Transformation::lookupFunctionDeclFromBases (this=this at entry=0x1604370, DName=..., CXXRD=CXXRD at entry=0x168efd0) at Transformation.cpp:505
#1 0x0000000000a6feb4 in Transformation::lookupFunctionDecl (this=0x1604370, DName=..., Ctx=<optimized out>) at Transformation.cpp:562
#2 0x00000000005d5a59 in CommonParameterRewriteVisitor<ParamToLocalRewriteVisitor, ParamToLocal>::VisitCallExpr (this=this at entry=0x165a1d0, CallE=CallE at entry=0x166c778)
at CommonParameterRewriteVisitor.h:115
#3 0x00000000005d6763 in WalkUpFromCallExpr (S=0x166c778, this=0x165a1d0) at /usr/local/include/clang/AST/StmtNodes.inc:299
#4 clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseCallExpr (this=0x165a1d0, S=0x166c778) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:2166
#5 0x00000000005daf98 in clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseParenExpr (this=0x165a1d0, S=<optimized out>)
at /usr/local/include/clang/AST/RecursiveASTVisitor.h:2222
#6 0x00000000005dfc57 in clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseUnaryExprOrTypeTraitExpr (this=0x165a1d0, S=0x1673590)
at /usr/local/include/clang/AST/RecursiveASTVisitor.h:2071
#7 0x00000000005d6a12 in clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::dataTraverse (this=0x165a1d0, S=<optimized out>)
at /usr/local/include/clang/AST/RecursiveASTVisitor.h:458
#8 0x00000000005e16d4 in TraverseVarDecl (D=0x166c620, this=0x165a1d0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1809
#9 clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseDecl (this=0x165a1d0, D=0x166c620) at /usr/local/include/clang/AST/DeclNodes.inc:385
#10 0x00000000005e14c6 in TraverseDeclContextHelper (DC=<optimized out>, this=0x165a1d0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1245
#11 TraverseCXXRecordDecl (D=<optimized out>, this=0x165a1d0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1617
#12 clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseDecl (this=0x165a1d0, D=<optimized out>) at /usr/local/include/clang/AST/DeclNodes.inc:227
#13 0x00000000005e1200 in TraverseClassTemplateDecl (D=0x166be30, this=0x165a1d0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1463
#14 clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseDecl (this=0x165a1d0, D=0x166be30) at /usr/local/include/clang/AST/DeclNodes.inc:177
#15 0x00000000005e1ce6 in TraverseDeclContextHelper (DC=<optimized out>, this=0x165a1d0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1245
#16 TraverseTranslationUnitDecl (D=<optimized out>, this=0x165a1d0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1333
#17 clang::RecursiveASTVisitor<ParamToLocalRewriteVisitor>::TraverseDecl (this=0x165a1d0, D=<optimized out>) at /usr/local/include/clang/AST/DeclNodes.inc:453
#18 0x00000000005c6840 in ParamToLocal::HandleTranslationUnit (this=0x1604370, Ctx=...) at ParamToLocal.cpp:89
#19 0x0000000000c1335b in clang::ParseAST(clang::Sema&, bool, bool) ()
#20 0x0000000000a8000a in TransformationManager::doTransformation (this=0x160de10, ErrorMsg="") at TransformationManager.cpp:187
#21 0x000000000045acce in main (argc=<optimized out>, argv=<optimized out>) at ClangDelta.cpp:188
2)
% gdb --args /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=copy-propagation --counter=1 clang_delta_crash_tmp_filejozDcb.i
Reading symbols from /var/tmp/creduce/clang_delta/clang_delta...done.
(gdb) run
Starting program: /var/tmp/creduce/clang_delta/clang_delta --transformation=copy-propagation --counter=1 clang_delta_crash_tmp_filejozDcb.i
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
Transformation::getInitExprByIndex (this=<optimized out>, Idxs=..., ILE=<optimized out>) at Transformation.cpp:175
175 const Type *T = SubILE->getType().getTypePtr();
(gdb) bt
#0 Transformation::getInitExprByIndex (this=<optimized out>, Idxs=..., ILE=<optimized out>) at Transformation.cpp:175
#1 0x0000000000a6e64e in Transformation::getInitExprFromBase (this=0x16024b0, BaseE=0x7fffffffddd0, Idxs=...) at Transformation.cpp:241
#2 0x0000000000a6e850 in Transformation::getMemberExprElem (this=this at entry=0x16024b0, ME=ME at entry=0x167ce40) at Transformation.cpp:297
#3 0x00000000004d6ed0 in CopyPropCollectionVisitor::VisitMemberExpr (this=this at entry=0x1657ff0, ME=ME at entry=0x167ce40) at CopyPropagation.cpp:190
#4 0x00000000004e3c55 in WalkUpFromMemberExpr (S=0x167ce40, this=0x1657ff0) at /usr/local/include/clang/AST/StmtNodes.inc:523
#5 clang::RecursiveASTVisitor<CopyPropCollectionVisitor>::TraverseMemberExpr (this=0x1657ff0, S=0x167ce40) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1966
#6 0x00000000004dbc38 in clang::RecursiveASTVisitor<CopyPropCollectionVisitor>::TraverseImplicitCastExpr (this=0x1657ff0, S=<optimized out>)
at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1973
#7 0x00000000004e4267 in TraverseImplicitParamDecl (D=0x167cdc0, this=0x1657ff0) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1813
#8 clang::RecursiveASTVisitor<CopyPropCollectionVisitor>::TraverseDecl (this=0x1657ff0, D=0x167cdc0) at /usr/local/include/clang/AST/DeclNodes.inc:389
#9 0x00000000004d9404 in TraverseDeclStmt (S=<optimized out>, this=<optimized out>) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1885
#10 clang::RecursiveASTVisitor<CopyPropCollectionVisitor>::TraverseStmt (this=0x1657ff0, S=0x167ce98) at /usr/local/include/clang/AST/StmtNodes.inc:91
#11 0x00000000004d9ee8 in clang::RecursiveASTVisitor<CopyPropCollectionVisitor>::TraverseCompoundStmt (this=0x1657ff0, S=<optimized out>)
at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1904
#12 0x00000000004e3fbf in clang::RecursiveASTVisitor<CopyPropCollectionVisitor>::TraverseFunctionHelper (this=0x1657ff0, D=0x167c760)
at /usr/local/include/clang/AST/RecursiveASTVisitor.h:1762
#13 0x00000000004d7d14 in CopyPropagation::HandleTopLevelDecl (this=0x16024b0, D=...) at CopyPropagation.cpp:244
#14 0x0000000000c13296 in clang::ParseAST(clang::Sema&, bool, bool) ()
#15 0x0000000000a8000a in TransformationManager::doTransformation (this=0x160de10, ErrorMsg="") at TransformationManager.cpp:187
#16 0x000000000045acce in main (argc=<optimized out>, argv=<optimized out>) at ClangDelta.cpp:188
--
Markus
-------------- next part --------------
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
extern "C"
extern "C"
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
template<typename T, T Value> struct IntegralConstant {
static const T value = Value;
};
template<typename From, typename To> struct ConvertibleTester {
private: static From create();
template<typename From1, typename To1> static char test(void);
public: static const bool value = sizeof(test<From, To>()) == sizeof(char);
};
template<typename From, typename To> struct IsConvertible : IntegralConstant<bool, ConvertibleTester<From, To>::value> {
};
template<bool B, typename T = void> struct EnableIf;
template<typename T> struct EnableIf<true, T> {
typedef T Type;
};
template<bool Condition, typename A, typename B> struct Conditional {
typedef A Type;
};
template<typename To, typename From> inline To BitwiseCast(void) ;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long int uintptr_t;
typedef int JSBool;
struct JSContext;
namespace JS {
class Value;
template <typename T> class Rooted;
struct Zone;
}
typedef ptrdiff_t jsid;
typedef uint16_t jschar;
typedef enum JSType {
}
JSType;
typedef enum JSProtoKey {
JSProto_LIMIT }
JSGCTraceKind;
typedef struct JSCompartment JSCompartment;
typedef struct JSRuntime JSRuntime;
class JSFunction;
class JSObject;
class JSScript;
class JSString;
namespace JS {
struct Runtime {
};
}
struct ContextFriendFields {
protected: JSRuntime *const runtime_;
JSCompartment *compartment_;
JS::Zone *zone_;
public: JSRuntime * ContextFriendFields_rt;
explicit ContextFriendFields(void) : runtime_(ContextFriendFields_rt), compartment_(__null), zone_(__null) {
}
};
struct PerThreadDataFriendFields {
};
template <typename T> struct GCMethods ;
template <typename T> class RootedBase {
};
template <typename T> class HandleBase {
};
template <typename T> class MutableHandleBase {
};
namespace JS {
template <typename T> class Handle : public HandleBase<T> {
public: template <typename S> Handle( void) ;
static Handle fromMarkedLocation(void) ;
template <typename S> inline Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy = 0);
const T *address() const ;
const T& get() const ;
operator const T&() const ;
T operator->() const ;
private: Handle() ;
const T *ptr;
};
typedef Handle<JSObject*> HandleObject;
typedef Handle<JSScript*> HandleScript;
typedef Handle<JSString*> HandleString;
typedef Handle<jsid> HandleId;
typedef Handle<Value> HandleValue;
template <typename T> class MutableHandle : public MutableHandleBase<T> {
public: ;
T *address() const ;
T get() const ;
operator T() const ;
T *ptr;
};
typedef MutableHandle<Value> MutableHandleValue;
}
template <typename T> struct GCMethods ;
namespace JS {
template <typename T> class Rooted : public RootedBase<T> {
public: Rooted(JSContext *cx ) : ptr(0) {
}
Rooted(JSContext *cx, T initial ) : ptr(initial) {
}
operator const T&() const ;
T operator->() const ;
T &operator=(T value) ;
T ptr;
};
typedef Rooted<JSObject*> RootedObject;
typedef Rooted<JSFunction*> RootedFunction;
typedef Rooted<JSString*> RootedString;
}
enum AllowGC {
};
template <typename T, AllowGC allowGC> class MaybeRooted ;
namespace JS {
template <typename T> template <typename S> inline Handle<T>::Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy) {
}
}
enum JSValueType {
JSVAL_TYPE_BOOLEAN , JSVAL_TYPE_STRING , JSVAL_TYPE_NULL , JSVAL_TYPE_OBJECT }
__attribute__((packed));
enum JSValueTag {
JSVAL_TAG_MAX_DOUBLE , JSVAL_TAG_STRING , JSVAL_TAG_BOOLEAN , JSVAL_TAG_NULL , JSVAL_TAG_OBJECT }
__attribute__((packed));
enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_NULL }
JSWhyMagic;
typedef union jsval_layout {
uint64_t asBits;
}
__attribute__((aligned )) jsval_layout;
jsval_layout JSVAL_IS_STRING_IMPL_l;
static inline JSBool JSVAL_IS_STRING_IMPL(void) {
return JSVAL_IS_STRING_IMPL_l.asBits >> 47 == JSVAL_TAG_STRING;
}
jsval_layout JSVAL_TO_STRING_IMPL_l;
static inline JSString * JSVAL_TO_STRING_IMPL(void) {
return (JSString *)(JSVAL_TO_STRING_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL);
}
jsval_layout JSVAL_IS_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_IS_BOOLEAN_IMPL(void) {
return JSVAL_IS_BOOLEAN_IMPL_l.asBits >> 47 == JSVAL_TAG_BOOLEAN;
}
jsval_layout JSVAL_TO_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_TO_BOOLEAN_IMPL(void) {
return JSVAL_TO_BOOLEAN_IMPL_l.asBits;
}
jsval_layout JSVAL_IS_OBJECT_IMPL_l;
static inline JSBool JSVAL_IS_OBJECT_IMPL(void) {
return JSVAL_IS_OBJECT_IMPL_l.asBits >= JSVAL_SHIFTED_TAG_NULL;
}
jsval_layout JSVAL_TO_OBJECT_IMPL_l;
static inline JSObject * JSVAL_TO_OBJECT_IMPL(void) {
uint64_t ptrBits = JSVAL_TO_OBJECT_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL;
return (JSObject *)ptrBits;
}
static inline jsval_layout JSVAL_TO_IMPL(void);
namespace JS {
class Value {
public:
bool isObject() const ;
JSObject &toObject() const ;
private: jsval_layout data;
friend jsval_layout (::JSVAL_TO_IMPL)(void);
};
}
template <class Outer> class ValueOperations {
const JS::Value * value() const ;
public:
JSObject &toObject() const ;
};
template <> class HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> > {
friend class ValueOperations;
const JS::Value * extract() const ;
};
JS::Value JSVAL_TO_IMPL_v;
inline jsval_layout JSVAL_TO_IMPL(void) {
return JSVAL_TO_IMPL_v.data;
}
typedef JS::Value jsval;
jsval JSVAL_IS_STRING_v;
static inline JSBool JSVAL_IS_STRING(void) {
return 0;
}
jsval JSVAL_TO_STRING_v;
static inline JSString * JSVAL_TO_STRING(void) {
return 0;
}
jsval JSVAL_IS_BOOLEAN_v;
static inline JSBool JSVAL_IS_BOOLEAN(void) {
return 0;
}
jsval JSVAL_TO_BOOLEAN_v;
static inline JSBool JSVAL_TO_BOOLEAN(void) {
return 0;
}
typedef JSBool (* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);
namespace JS {
enum UsedRval {
IncludeUsedRval, NoUsedRval };
template<UsedRval WantUsedRval> class UsedRvalBase;
template<> class UsedRvalBase<NoUsedRval> {
};
template<UsedRval WantUsedRval> class CallReceiverBase : public UsedRvalBase< NoUsedRval > {
protected: Value *argv_;
public:
HandleValue thisv() const ;
};
class CallReceiver : public CallReceiverBase<IncludeUsedRval> {
};
template<UsedRval WantUsedRval> class CallArgsBase : public Conditional<WantUsedRval == IncludeUsedRval, CallReceiver, CallReceiverBase<NoUsedRval> >::Type {
protected: unsigned argc_;
public: unsigned length() const ;
HandleValue handleOrUndefinedAt(unsigned i) const ;
};
class CallArgs : public CallArgsBase<IncludeUsedRval> {
private: friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);
static CallArgs create(unsigned argc, Value *argv) ;
};
__attribute__((always_inline)) inline CallArgs CallArgsFromVp(unsigned argc, Value *vp) {
return CallArgs::create(argc, vp + 2);
}
}
template <class T, size_t N, class AP, bool IsPod> struct VectorImpl ;
template <class T, size_t N, class AllocPolicy> class Vector : private AllocPolicy {
size_t mLength;
public: static const size_t sMaxInlineStorage = N;
Vector(AllocPolicy = AllocPolicy());
bool empty() const ;
};
namespace JS {
class __attribute__((visibility("default"))) AutoGCRooter ;
typedef bool (*IsAcceptableThis)(const Value &v);
typedef bool (*NativeImpl)(JSContext *cx, CallArgs args);
extern __attribute__((visibility("default"))) bool CallMethodIfWrapped;
template<IsAcceptableThis Test, NativeImpl Impl> __attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, CallArgs args) ;
__attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args) {
const Value &thisv = args.thisv();
if (Test(thisv)) return 0;
return 0;
}
}
typedef JSBool (* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
typedef JSBool (* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);
extern __attribute__((visibility("default"))) JSBool JS_ConvertValue;
namespace JS {
}
typedef struct JSJitInfo JSJitInfo;
typedef struct JSStrictPropertyOpWrapper {
JSStrictPropertyOp op;
const JSJitInfo *info;
}
JSStrictPropertyOpWrapper;
typedef struct JSPropertyOpWrapper {
JSPropertyOp op;
const JSJitInfo *info;
}
JSPropertyOpWrapper;
struct JSPropertySpec {
const char *name;
int8_t tinyid;
uint8_t flags;
JSPropertyOpWrapper getter;
JSStrictPropertyOpWrapper setter;
};
using JS::Value;
using JS::CallArgs;
using JS::Rooted;
using JS::RootedObject;
using JS::RootedFunction;
using JS::RootedString;
using JS::Handle;
using JS::HandleObject;
using JS::HandleString;
using JS::HandleId;
using JS::MutableHandleValue;
typedef uint8_t jsbytecode;
class JSAtom;
class RegExpObject;
class RegExpStatics;
enum RegExpFlag {
};
class FrameRegs;
class GlobalObject;
class Shape;
struct TypeObject;
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Rooted<JSAtom*> RootedAtom;
struct MatchPair {
};
struct MatchConduit {
explicit MatchConduit(MatchPair *pair) ;
};
template<typename T> class LinkedListElement {
};
class SpecialId ;
struct Class ;
struct BaseShape ;
class Trans_NS_shadow_Shape ;
struct Object ;
namespace JS {
struct ArenaHeader {
};
}
struct ArenaHeader;
struct Chunk;
enum AllocKind {
FINALIZE_OBJECT4_BACKGROUND, FINALIZE_IONCODE, FINALIZE_LAST };
struct Cell {
public: inline ArenaHeader *arenaHeader() const;
__attribute__((always_inline)) inline void unmark(uint32_t color) const;
protected: inline uintptr_t address() const;
inline Chunk *chunk() const;
uintptr_t first;
uintptr_t last;
static size_t encodeOffsets ;
uintptr_t arenaAddress() const ;
};
struct ArenaHeader : public JS::ArenaHeader {
size_t allocKind : 8;
;
private: static __attribute__((visibility("default"))) const uint32_t ThingSizes[];
};
static void AssertValidColor(const void *thing, uint32_t color) {
}
void Cell::unmark(uint32_t color) const {
AssertValidColor(this, color);
}
template<class T, typename Unioned = uintptr_t> class EncapsulatedPtr {
protected: union {
T *value;
};
public:
T *operator->() const ;
operator T*() const ;
};
template <class T, class Unioned = uintptr_t> class HeapPtr : public EncapsulatedPtr<T, Unioned> {
};
template <class T> class FixedHeapPtr {
T *value;
public: operator T*() const ;
};
typedef HeapPtr<JSObject> HeapPtrObject;
typedef HeapPtr<TypeObject> HeapPtrTypeObject;
class EncapsulatedValue : public ValueOperations<EncapsulatedValue> {
protected: Value value;
public:
operator const Value &() const ;
};
class HeapSlot : public EncapsulatedValue {
};
template<class T> class ReadBarriered ;;
struct TypeObjectKey ;
class Type ;
struct TypeNewScript ;
struct TypeObject : Cell {
Class *clasp;
HeapPtrObject proto;
};
template <AllowGC allowGC> extern JSString * ToStringSlow(JSContext *cx, typename MaybeRooted<Value, allowGC>::HandleType arg);
template <AllowGC allowGC> static __attribute__((always_inline)) inline JSString * ToString(JSContext *cx, JS::HandleValue v) ;
class JSString : public Cell {
protected: static const size_t NUM_INLINE_CHARS = 2 * sizeof(void *) / sizeof(jschar);
struct Data {
size_t lengthAndFlags;
union {
const jschar *chars;
}
u1;
}
d;
public: static const size_t LENGTH_SHIFT = 4;
public: __attribute__((always_inline)) inline size_t length() const ;
};
class JSLinearString : public JSString {
public: __attribute__((always_inline)) inline const jschar *chars() const ;
};
class JSFlatString : public JSLinearString {
};
class JSAtom : public JSFlatString {
};
class PropertyName : public JSAtom {
};
class ObjectImpl : public Cell {
HeapPtrTypeObject type_;
public:
Class *getClass() const ;
HeapSlot *fixedSlots() const ;
uint32_t numFixedSlots() const ;
const Value &getSlot(uint32_t slot) const ;
inline void *&privateRef(uint32_t nfixed) const ;
inline void *getPrivate() const {
return 0;
}
};
class JSObject : public ObjectImpl {
public: ;
template <class T> inline bool is() const ;
template <class T> T &as() ;
};
class JSFunction : public JSObject {
public: static Class class_;
union U {
struct Scripted {
union
s;
}
i;
}
u;
JSScript *nonLazyScript() const ;
static const AllocKind FinalizeKind = FINALIZE_OBJECT4_BACKGROUND;
};
class StackFrame ;
class InterpreterActivation;
class Activation {
protected: JSContext *cx_;
public:
InterpreterActivation *asInterpreter() const ;
};
class InterpreterActivation : public Activation {
StackFrame *current_;
public: ;
};
struct JSAtomState {
FixedHeapPtr<PropertyName> RegExp;
};
class PerThreadData : public PerThreadDataFriendFields {
public: uint8_t *ionTop;
Activation *activation_;
};
template<class Client> struct MallocProvider {
};
struct JSRuntime : public JS::Runtime, public MallocProvider<JSRuntime> {
PerThreadData mainThread;
union {
JSAtomState atomState;
};
};
struct ThreadSafeContext : ContextFriendFields, public MallocProvider<ThreadSafeContext> {
};
struct JSContext : ThreadSafeContext, public LinkedListElement<JSContext> {
JSRuntime *runtime() const ;
JSCompartment *compartment() const ;
inline Handle<GlobalObject*> global() const;
inline RegExpStatics *regExpStatics();
enum MaybeAllowCrossCompartment {
};
;
JSAtomState & names() ;
};
class ContextAllocPolicy ;;
enum RegExpRunStatus {
RegExpRunStatus_Error, RegExpRunStatus_Success_NotFound };
class RegExpObjectBuilder {
public: RegExpObjectBuilder(JSContext *cx, RegExpObject *reobj = __null);
RegExpObject *build(HandleAtom source, RegExpFlag flags);
};
class RegExpObject : public JSObject {
public: static const unsigned RESERVED_SLOTS = 6;
static Class class_;
};
RegExpRunStatus Trans_NS_js_ExecuteRegExp(JSContext *cx, HandleObject regexp, HandleString string, MatchConduit &matches);
extern JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp);
class StringBuffer ;
class GlobalObject : public JSObject {
static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 3;
static const unsigned EVAL = STANDARD_CLASS_SLOTS;
static const unsigned CREATE_DATAVIEW_FOR_THIS = EVAL + 1;
static const unsigned THROWTYPEERROR = CREATE_DATAVIEW_FOR_THIS + 1;
static const unsigned PROTO_GETTER = THROWTYPEERROR + 1;
static const unsigned FROM_BUFFER_UINT8 = PROTO_GETTER + 1;
static const unsigned FROM_BUFFER_INT8 = FROM_BUFFER_UINT8 + 1;
static const unsigned FROM_BUFFER_UINT16 = FROM_BUFFER_INT8 + 1;
static const unsigned FROM_BUFFER_INT16 = FROM_BUFFER_UINT16 + 1;
static const unsigned FROM_BUFFER_UINT32 = FROM_BUFFER_INT16 + 1;
static const unsigned FROM_BUFFER_INT32 = FROM_BUFFER_UINT32 + 1;
static const unsigned FROM_BUFFER_FLOAT32 = FROM_BUFFER_INT32 + 1;
static const unsigned FROM_BUFFER_FLOAT64 = FROM_BUFFER_FLOAT32 + 1;
static const unsigned FROM_BUFFER_UINT8CLAMPED = FROM_BUFFER_FLOAT64 + 1;
static const unsigned ELEMENT_ITERATOR_PROTO = FROM_BUFFER_UINT8CLAMPED + 1;
static const unsigned GENERATOR_PROTO = ELEMENT_ITERATOR_PROTO + 1;
static const unsigned MAP_ITERATOR_PROTO = GENERATOR_PROTO + 1;
static const unsigned SET_ITERATOR_PROTO = MAP_ITERATOR_PROTO + 1;
static const unsigned COLLATOR_PROTO = SET_ITERATOR_PROTO + 1;
static const unsigned NUMBER_FORMAT_PROTO = COLLATOR_PROTO + 1;
static const unsigned DATE_TIME_FORMAT_PROTO = NUMBER_FORMAT_PROTO + 1;
static const unsigned REGEXP_STATICS = DATE_TIME_FORMAT_PROTO + 1;
public: ;
JSFunction * createConstructor(JSContext *cx, JSNative ctor, JSAtom *name, unsigned length, AllocKind kind = JSFunction::FinalizeKind);
JSObject *createBlankPrototype;
inline RegExpStatics *getRegExpStatics() const;
};
struct JSCompartment ;
inline Handle<GlobalObject*> JSContext::global() const {
return Handle<GlobalObject*>::fromMarkedLocation();
}
class RegExpStatics {
RegExpFlag flags;
RegExpStatics *bufferLink;
bool copied;
public:
inline void setMultiline(JSContext *cx, bool enabled);
inline void setPendingInput(JSString *newInput);
RegExpFlag getFlags() const ;
bool createPendingInput(JSContext *cx, MutableHandleValue out);
bool createLastMatch(JSContext *cx, MutableHandleValue out);
bool createLastParen(JSContext *cx, MutableHandleValue out);
bool createParen(JSContext *cx, size_t pairNum, MutableHandleValue out);
bool createLeftContext(JSContext *cx, MutableHandleValue out);
bool createRightContext(JSContext *cx, MutableHandleValue out);
};
inline RegExpStatics * GlobalObject::getRegExpStatics() const {
JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
return static_cast<RegExpStatics *>(resObj.getPrivate());
}
inline void RegExpStatics::setPendingInput(JSString *newInput) {
}
inline void RegExpStatics::setMultiline(JSContext *cx, bool enabled) {
}
inline RegExpStatics * JSContext::regExpStatics() {
return 0;
}
size_t EscapeNakedForwardSlashes_oldLen = 0;
const jschar *EscapeNakedForwardSlashes_oldChars = 0;
static JSAtom * EscapeNakedForwardSlashes(JSContext *cx, HandleAtom unescaped) {
for (const jschar *it = EscapeNakedForwardSlashes_oldChars;
it < EscapeNakedForwardSlashes_oldChars + EscapeNakedForwardSlashes_oldLen;
++it)
return 0 ? 0 : 0;
}
RegExpFlag CompileRegExpObject_flags = RegExpFlag(0);
RegExpStatics *CompileRegExpObject_res = 0;
static bool CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args) {
RootedAtom source(cx);
RootedAtom escapedSourceStr(cx, EscapeNakedForwardSlashes(cx, source));
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(CompileRegExpObject_flags | CompileRegExpObject_res->getFlags()));
if (!reobj) return false;
}
__attribute__((always_inline)) inline bool IsRegExp(const Value &v) {
return 0 && 0;
}
__attribute__((always_inline)) inline bool regexp_compile_impl(JSContext *cx, CallArgs args) {
RegExpObjectBuilder builder(cx, &args.thisv().toObject().as<RegExpObject>());
return CompileRegExpObject(cx, builder, args);
}
static JSBool regexp_construct(JSContext *cx, unsigned argc, Value *vp) {
return true;
};
RegExpStatics *static_input_getter_res = 0;
static JSBool static_input_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_input_getter_res->createPendingInput(cx, vp);
}
static JSBool static_multiline_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return true;
}
RegExpStatics *static_lastMatch_getter_res = 0;
static JSBool static_lastMatch_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastMatch_getter_res->createLastMatch(cx, vp);
}
RegExpStatics *static_lastParen_getter_res = 0;
static JSBool static_lastParen_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastParen_getter_res->createLastParen(cx, vp);
}
RegExpStatics *static_leftContext_getter_res = 0;
static JSBool static_leftContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_leftContext_getter_res->createLeftContext(cx, vp);
}
RegExpStatics *static_rightContext_getter_res = 0;
static JSBool static_rightContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_rightContext_getter_res->createRightContext(cx, vp);
}
RegExpStatics *static_paren1_getter_res = 0;
static JSBool static_paren1_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren1_getter_res->createParen(cx, 1, vp);
}
RegExpStatics *static_paren2_getter_res = 0;
static JSBool static_paren2_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren2_getter_res->createParen(cx, 2, vp);
}
RegExpStatics *static_paren3_getter_res = 0;
static JSBool static_paren3_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren3_getter_res->createParen(cx, 3, vp);
}
RegExpStatics *static_paren4_getter_res = 0;
static JSBool static_paren4_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren4_getter_res->createParen(cx, 4, vp);
}
RegExpStatics *static_paren5_getter_res = 0;
static JSBool static_paren5_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren5_getter_res->createParen(cx, 5, vp);
}
RegExpStatics *static_paren6_getter_res = 0;
static JSBool static_paren6_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren6_getter_res->createParen(cx, 6, vp);
}
RegExpStatics *static_paren7_getter_res = 0;
static JSBool static_paren7_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren7_getter_res->createParen(cx, 7, vp);
}
RegExpStatics *static_paren8_getter_res = 0;
static JSBool static_paren8_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren8_getter_res->createParen(cx, 8, vp);
}
RegExpStatics *static_paren9_getter_res = 0;
static JSBool static_paren9_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren9_getter_res->createParen(cx, 9, vp);
}
RegExpStatics *static_input_setter_res = 0;
static JSBool static_input_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_input_setter_res->setPendingInput(0);
}
RegExpStatics *static_multiline_setter_res = 0;
static JSBool static_multiline_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_multiline_setter_res->setMultiline(cx, !!0);
}
const uint8_t REGEXP_STATIC_PROP_ATTRS = 0x04 | 0x40 | 0x01;
const uint8_t RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | 0x02;
static const JSPropertySpec regexp_static_props[] = {
"input", 0, REGEXP_STATIC_PROP_ATTRS,
static_input_getter, __null
,
static_input_setter, __null
,
"multiline", 0, REGEXP_STATIC_PROP_ATTRS,
static_multiline_getter, __null
,
static_multiline_setter, __null
, {
"lastMatch", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastMatch_getter, __null
}
, {
"lastParen", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastParen_getter, __null
}
, {
"leftContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_leftContext_getter, __null
}
, {
"rightContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_rightContext_getter, __null
}
, {
"$1", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren1_getter, __null
}
, {
"$2", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren2_getter, __null
}
, {
"$3", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren3_getter, __null
}
, {
"$4", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren4_getter, __null
}
, {
"$5", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren5_getter, __null
}
, {
"$6", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren6_getter, __null
}
, {
"$7", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren7_getter, __null
}
, {
"$8", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren8_getter, __null
}
,
"$9", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren9_getter, __null
};
JSObject * js_InitRegExpClass(JSContext *cx, HandleObject obj) {
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
RootedFunction ctor(cx);
ctor = global->createConstructor(cx, regexp_construct, 0, 2);
return 0;
}
static RegExpRunStatus ExecuteRegExp(JSContext *cx, CallArgs args, MatchConduit &matches) {
RootedObject regexp(cx, &args.thisv().toObject());
RootedString string(cx, 0);
return Trans_NS_js_ExecuteRegExp(cx, regexp, string, matches);
}
static bool regexp_test_impl(JSContext *cx, CallArgs args) {
MatchPair match;
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, args, conduit);
return status != RegExpRunStatus_Error;
}
JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
}
// this should reproduce the crash:
// /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=param-to-local --counter=6 /var/tmp/moz-build-dir/js/src/clang_delta_crash_tmp_fileBmJ6xQ.ii
-------------- next part --------------
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
extern "C"
extern "C"
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
template<typename T, T Value> struct IntegralConstant {
static const T value = Value;
};
template<typename From, typename To> struct ConvertibleTester {
private: static From create();
template<typename From1, typename To1> static char test(void);
public: static const bool value = sizeof(test<From, To>()) == sizeof(char);
};
template<typename From, typename To> struct IsConvertible : IntegralConstant<bool, ConvertibleTester<From, To>::value> {
};
template<bool B, typename T = void> struct EnableIf;
template<typename T> struct EnableIf<true, T> {
typedef T Type;
};
template<bool Condition, typename A, typename B> struct Conditional {
typedef A Type;
};
template<typename To, typename From> inline To BitwiseCast(void) ;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long int uintptr_t;
typedef int JSBool;
struct JSContext;
namespace JS {
class Value;
template <typename T> class Rooted;
struct Zone;
}
typedef ptrdiff_t jsid;
typedef uint16_t jschar;
typedef enum JSType {
}
JSType;
typedef enum JSProtoKey {
JSProto_LIMIT }
JSGCTraceKind;
typedef struct JSCompartment JSCompartment;
typedef struct JSRuntime JSRuntime;
class JSFunction;
class JSObject;
class JSScript;
class JSString;
namespace JS {
struct Runtime {
};
}
struct ContextFriendFields {
protected: JSRuntime *const runtime_;
JSCompartment *compartment_;
JS::Zone *zone_;
public: JSRuntime * ContextFriendFields_rt;
explicit ContextFriendFields(void) : runtime_(ContextFriendFields_rt), compartment_(__null), zone_(__null) {
}
};
struct PerThreadDataFriendFields {
};
template <typename T> struct GCMethods ;
template <typename T> class RootedBase {
};
template <typename T> class HandleBase {
};
template <typename T> class MutableHandleBase {
};
namespace JS {
template <typename T> class Handle : public HandleBase<T> {
public: template <typename S> Handle( void) ;
static Handle fromMarkedLocation(void) ;
template <typename S> inline Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy = 0);
const T *address() const ;
const T& get() const ;
operator const T&() const ;
T operator->() const ;
private: Handle() ;
const T *ptr;
};
typedef Handle<JSObject*> HandleObject;
typedef Handle<JSScript*> HandleScript;
typedef Handle<JSString*> HandleString;
typedef Handle<jsid> HandleId;
typedef Handle<Value> HandleValue;
template <typename T> class MutableHandle : public MutableHandleBase<T> {
public: ;
T *address() const ;
T get() const ;
operator T() const ;
T *ptr;
};
typedef MutableHandle<Value> MutableHandleValue;
}
template <typename T> struct GCMethods ;
namespace JS {
template <typename T> class Rooted : public RootedBase<T> {
public: Rooted(JSContext *cx ) : ptr(0) {
}
Rooted(JSContext *cx, T initial ) : ptr(initial) {
}
operator const T&() const ;
T operator->() const ;
T &operator=(T value) ;
T ptr;
};
typedef Rooted<JSObject*> RootedObject;
typedef Rooted<JSFunction*> RootedFunction;
typedef Rooted<JSString*> RootedString;
}
enum AllowGC {
};
template <typename T, AllowGC allowGC> class MaybeRooted ;
namespace JS {
template <typename T> template <typename S> inline Handle<T>::Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy) {
}
}
enum JSValueType {
JSVAL_TYPE_BOOLEAN , JSVAL_TYPE_STRING , JSVAL_TYPE_NULL , JSVAL_TYPE_OBJECT }
__attribute__((packed));
enum JSValueTag {
JSVAL_TAG_MAX_DOUBLE , JSVAL_TAG_STRING , JSVAL_TAG_BOOLEAN , JSVAL_TAG_NULL , JSVAL_TAG_OBJECT }
__attribute__((packed));
enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_NULL }
JSWhyMagic;
typedef union jsval_layout {
uint64_t asBits;
}
__attribute__((aligned )) jsval_layout;
jsval_layout JSVAL_IS_STRING_IMPL_l;
static inline JSBool JSVAL_IS_STRING_IMPL(void) {
return JSVAL_IS_STRING_IMPL_l.asBits >> 47 == JSVAL_TAG_STRING;
}
jsval_layout JSVAL_TO_STRING_IMPL_l;
static inline JSString * JSVAL_TO_STRING_IMPL(void) {
return (JSString *)(JSVAL_TO_STRING_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL);
}
jsval_layout JSVAL_IS_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_IS_BOOLEAN_IMPL(void) {
return JSVAL_IS_BOOLEAN_IMPL_l.asBits >> 47 == JSVAL_TAG_BOOLEAN;
}
jsval_layout JSVAL_TO_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_TO_BOOLEAN_IMPL(void) {
return JSVAL_TO_BOOLEAN_IMPL_l.asBits;
}
jsval_layout JSVAL_IS_OBJECT_IMPL_l;
static inline JSBool JSVAL_IS_OBJECT_IMPL(void) {
return JSVAL_IS_OBJECT_IMPL_l.asBits >= JSVAL_SHIFTED_TAG_NULL;
}
jsval_layout JSVAL_TO_OBJECT_IMPL_l;
static inline JSObject * JSVAL_TO_OBJECT_IMPL(void) {
uint64_t ptrBits = JSVAL_TO_OBJECT_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL;
return (JSObject *)ptrBits;
}
static inline jsval_layout JSVAL_TO_IMPL(void);
namespace JS {
class Value {
public:
bool isObject() const ;
JSObject &toObject() const ;
private: jsval_layout data;
friend jsval_layout (::JSVAL_TO_IMPL)(void);
};
}
template <class Outer> class ValueOperations {
const JS::Value * value() const ;
public:
JSObject &toObject() const ;
};
template <> class HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> > {
friend class ValueOperations;
const JS::Value * extract() const ;
};
JS::Value JSVAL_TO_IMPL_v;
inline jsval_layout JSVAL_TO_IMPL(void) {
return JSVAL_TO_IMPL_v.data;
}
typedef JS::Value jsval;
jsval JSVAL_IS_STRING_v;
static inline JSBool JSVAL_IS_STRING(void) {
return 0;
}
jsval JSVAL_TO_STRING_v;
static inline JSString * JSVAL_TO_STRING(void) {
return 0;
}
jsval JSVAL_IS_BOOLEAN_v;
static inline JSBool JSVAL_IS_BOOLEAN(void) {
return 0;
}
static inline JSBool JSVAL_TO_BOOLEAN(jsval v) {
return 0;
}
typedef JSBool (* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);
namespace JS {
enum UsedRval {
IncludeUsedRval, NoUsedRval };
template<UsedRval WantUsedRval> class UsedRvalBase;
template<> class UsedRvalBase<NoUsedRval> {
};
template<UsedRval WantUsedRval> class CallReceiverBase : public UsedRvalBase< NoUsedRval > {
protected: Value *argv_;
public:
HandleValue thisv() const ;
};
class CallReceiver : public CallReceiverBase<IncludeUsedRval> {
};
template<UsedRval WantUsedRval> class CallArgsBase : public Conditional<WantUsedRval == IncludeUsedRval, CallReceiver, CallReceiverBase<NoUsedRval> >::Type {
protected: unsigned argc_;
public: unsigned length() const ;
HandleValue handleOrUndefinedAt(unsigned i) const ;
};
class CallArgs : public CallArgsBase<IncludeUsedRval> {
private: friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);
static CallArgs create(unsigned argc, Value *argv) ;
};
__attribute__((always_inline)) inline CallArgs CallArgsFromVp(unsigned argc, Value *vp) {
return CallArgs::create(argc, vp + 2);
}
}
template <class T, size_t N, class AP, bool IsPod> struct VectorImpl ;
template <class T, size_t N, class AllocPolicy> class Vector : private AllocPolicy {
size_t mLength;
public: static const size_t sMaxInlineStorage = N;
Vector(AllocPolicy = AllocPolicy());
bool empty() const ;
};
namespace JS {
class __attribute__((visibility("default"))) AutoGCRooter ;
typedef bool (*IsAcceptableThis)(const Value &v);
typedef bool (*NativeImpl)(JSContext *cx, CallArgs args);
extern __attribute__((visibility("default"))) bool CallMethodIfWrapped;
template<IsAcceptableThis Test, NativeImpl Impl> __attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, CallArgs args) ;
__attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args) {
const Value &thisv = args.thisv();
if (Test(thisv)) return 0;
return 0;
}
}
typedef JSBool (* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
typedef JSBool (* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);
extern __attribute__((visibility("default"))) JSBool JS_ConvertValue;
namespace JS {
}
typedef struct JSJitInfo JSJitInfo;
typedef struct JSStrictPropertyOpWrapper {
JSStrictPropertyOp op;
const JSJitInfo *info;
}
JSStrictPropertyOpWrapper;
typedef struct JSPropertyOpWrapper {
JSPropertyOp op;
const JSJitInfo *info;
}
JSPropertyOpWrapper;
struct JSPropertySpec {
const char *name;
int8_t tinyid;
uint8_t flags;
JSPropertyOpWrapper getter;
JSStrictPropertyOpWrapper setter;
};
using JS::Value;
using JS::CallArgs;
using JS::Rooted;
using JS::RootedObject;
using JS::RootedFunction;
using JS::RootedString;
using JS::Handle;
using JS::HandleObject;
using JS::HandleString;
using JS::HandleId;
using JS::MutableHandleValue;
typedef uint8_t jsbytecode;
class JSAtom;
class RegExpObject;
class RegExpStatics;
enum RegExpFlag {
};
class FrameRegs;
class GlobalObject;
class Shape;
struct TypeObject;
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Rooted<JSAtom*> RootedAtom;
struct MatchPair {
};
struct MatchConduit {
explicit MatchConduit(MatchPair *pair) ;
};
template<typename T> class LinkedListElement {
};
class SpecialId ;
struct Class ;
struct BaseShape ;
class Trans_NS_shadow_Shape ;
struct Object ;
namespace JS {
struct ArenaHeader {
};
}
struct ArenaHeader;
struct Chunk;
enum AllocKind {
FINALIZE_OBJECT4_BACKGROUND, FINALIZE_IONCODE, FINALIZE_LAST };
struct Cell {
public: inline ArenaHeader *arenaHeader() const;
__attribute__((always_inline)) inline void unmark(uint32_t color) const;
protected: inline uintptr_t address() const;
inline Chunk *chunk() const;
uintptr_t first;
uintptr_t last;
static size_t encodeOffsets ;
uintptr_t arenaAddress() const ;
};
struct ArenaHeader : public JS::ArenaHeader {
size_t allocKind : 8;
;
private: static __attribute__((visibility("default"))) const uint32_t ThingSizes[];
};
static void AssertValidColor(const void *thing, uint32_t color) {
}
void Cell::unmark(uint32_t color) const {
AssertValidColor(this, color);
}
template<class T, typename Unioned = uintptr_t> class EncapsulatedPtr {
protected: union {
T *value;
};
public:
T *operator->() const ;
operator T*() const ;
};
template <class T, class Unioned = uintptr_t> class HeapPtr : public EncapsulatedPtr<T, Unioned> {
};
template <class T> class FixedHeapPtr {
T *value;
public: operator T*() const ;
};
typedef HeapPtr<JSObject> HeapPtrObject;
typedef HeapPtr<TypeObject> HeapPtrTypeObject;
class EncapsulatedValue : public ValueOperations<EncapsulatedValue> {
protected: Value value;
public:
operator const Value &() const ;
};
class HeapSlot : public EncapsulatedValue {
};
template<class T> class ReadBarriered ;;
struct TypeObjectKey ;
class Type ;
struct TypeNewScript ;
struct TypeObject : Cell {
Class *clasp;
HeapPtrObject proto;
};
template <AllowGC allowGC> extern JSString * ToStringSlow(JSContext *cx, typename MaybeRooted<Value, allowGC>::HandleType arg);
template <AllowGC allowGC> static __attribute__((always_inline)) inline JSString * ToString(JSContext *cx, JS::HandleValue v) ;
class JSString : public Cell {
protected: static const size_t NUM_INLINE_CHARS = 2 * sizeof(void *) / sizeof(jschar);
struct Data {
size_t lengthAndFlags;
union {
const jschar *chars;
}
u1;
}
d;
public: static const size_t LENGTH_SHIFT = 4;
public: __attribute__((always_inline)) inline size_t length() const ;
};
class JSLinearString : public JSString {
public: __attribute__((always_inline)) inline const jschar *chars() const ;
};
class JSFlatString : public JSLinearString {
};
class JSAtom : public JSFlatString {
};
class PropertyName : public JSAtom {
};
class ObjectImpl : public Cell {
HeapPtrTypeObject type_;
public:
Class *getClass() const ;
HeapSlot *fixedSlots() const ;
uint32_t numFixedSlots() const ;
const Value &getSlot(uint32_t slot) const ;
inline void *&privateRef(uint32_t nfixed) const ;
inline void *getPrivate() const {
return 0;
}
};
class JSObject : public ObjectImpl {
public: ;
template <class T> inline bool is() const ;
template <class T> T &as() ;
};
class JSFunction : public JSObject {
public: static Class class_;
union U {
struct Scripted {
union
s;
}
i;
}
u;
JSScript *nonLazyScript() const ;
static const AllocKind FinalizeKind = FINALIZE_OBJECT4_BACKGROUND;
};
class StackFrame ;
class InterpreterActivation;
class Activation {
protected: JSContext *cx_;
public:
InterpreterActivation *asInterpreter() const ;
};
class InterpreterActivation : public Activation {
StackFrame *current_;
public: ;
};
struct JSAtomState {
FixedHeapPtr<PropertyName> RegExp;
};
class PerThreadData : public PerThreadDataFriendFields {
public: uint8_t *ionTop;
Activation *activation_;
};
template<class Client> struct MallocProvider {
};
struct JSRuntime : public JS::Runtime, public MallocProvider<JSRuntime> {
PerThreadData mainThread;
union {
JSAtomState atomState;
};
};
struct ThreadSafeContext : ContextFriendFields, public MallocProvider<ThreadSafeContext> {
};
struct JSContext : ThreadSafeContext, public LinkedListElement<JSContext> {
JSRuntime *runtime() const ;
JSCompartment *compartment() const ;
inline Handle<GlobalObject*> global() const;
inline RegExpStatics *regExpStatics();
enum MaybeAllowCrossCompartment {
};
;
JSAtomState & names() ;
};
class ContextAllocPolicy ;;
enum RegExpRunStatus {
RegExpRunStatus_Error, RegExpRunStatus_Success_NotFound };
class RegExpObjectBuilder {
public: RegExpObjectBuilder(JSContext *cx, RegExpObject *reobj = __null);
RegExpObject *build(HandleAtom source, RegExpFlag flags);
};
class RegExpObject : public JSObject {
public: static const unsigned RESERVED_SLOTS = 6;
static Class class_;
};
RegExpRunStatus Trans_NS_js_ExecuteRegExp(JSContext *cx, HandleObject regexp, HandleString string, MatchConduit &matches);
extern JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp);
class StringBuffer ;
class GlobalObject : public JSObject {
static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 3;
static const unsigned EVAL = STANDARD_CLASS_SLOTS;
static const unsigned CREATE_DATAVIEW_FOR_THIS = EVAL + 1;
static const unsigned THROWTYPEERROR = CREATE_DATAVIEW_FOR_THIS + 1;
static const unsigned PROTO_GETTER = THROWTYPEERROR + 1;
static const unsigned FROM_BUFFER_UINT8 = PROTO_GETTER + 1;
static const unsigned FROM_BUFFER_INT8 = FROM_BUFFER_UINT8 + 1;
static const unsigned FROM_BUFFER_UINT16 = FROM_BUFFER_INT8 + 1;
static const unsigned FROM_BUFFER_INT16 = FROM_BUFFER_UINT16 + 1;
static const unsigned FROM_BUFFER_UINT32 = FROM_BUFFER_INT16 + 1;
static const unsigned FROM_BUFFER_INT32 = FROM_BUFFER_UINT32 + 1;
static const unsigned FROM_BUFFER_FLOAT32 = FROM_BUFFER_INT32 + 1;
static const unsigned FROM_BUFFER_FLOAT64 = FROM_BUFFER_FLOAT32 + 1;
static const unsigned FROM_BUFFER_UINT8CLAMPED = FROM_BUFFER_FLOAT64 + 1;
static const unsigned ELEMENT_ITERATOR_PROTO = FROM_BUFFER_UINT8CLAMPED + 1;
static const unsigned GENERATOR_PROTO = ELEMENT_ITERATOR_PROTO + 1;
static const unsigned MAP_ITERATOR_PROTO = GENERATOR_PROTO + 1;
static const unsigned SET_ITERATOR_PROTO = MAP_ITERATOR_PROTO + 1;
static const unsigned COLLATOR_PROTO = SET_ITERATOR_PROTO + 1;
static const unsigned NUMBER_FORMAT_PROTO = COLLATOR_PROTO + 1;
static const unsigned DATE_TIME_FORMAT_PROTO = NUMBER_FORMAT_PROTO + 1;
static const unsigned REGEXP_STATICS = DATE_TIME_FORMAT_PROTO + 1;
public: ;
JSFunction * createConstructor(JSContext *cx, JSNative ctor, JSAtom *name, unsigned length, AllocKind kind = JSFunction::FinalizeKind);
JSObject *createBlankPrototype;
inline RegExpStatics *getRegExpStatics() const;
};
struct JSCompartment ;
inline Handle<GlobalObject*> JSContext::global() const {
return Handle<GlobalObject*>::fromMarkedLocation();
}
class RegExpStatics {
RegExpFlag flags;
RegExpStatics *bufferLink;
bool copied;
public:
inline void setMultiline(JSContext *cx, bool enabled);
inline void setPendingInput(JSString *newInput);
RegExpFlag getFlags() const ;
bool createPendingInput(JSContext *cx, MutableHandleValue out);
bool createLastMatch(JSContext *cx, MutableHandleValue out);
bool createLastParen(JSContext *cx, MutableHandleValue out);
bool createParen(JSContext *cx, size_t pairNum, MutableHandleValue out);
bool createLeftContext(JSContext *cx, MutableHandleValue out);
bool createRightContext(JSContext *cx, MutableHandleValue out);
};
inline RegExpStatics * GlobalObject::getRegExpStatics() const {
JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
return static_cast<RegExpStatics *>(resObj.getPrivate());
}
inline void RegExpStatics::setPendingInput(JSString *newInput) {
}
inline void RegExpStatics::setMultiline(JSContext *cx, bool enabled) {
}
inline RegExpStatics * JSContext::regExpStatics() {
return 0;
}
size_t EscapeNakedForwardSlashes_oldLen = 0;
const jschar *EscapeNakedForwardSlashes_oldChars = 0;
static JSAtom * EscapeNakedForwardSlashes(JSContext *cx, HandleAtom unescaped) {
for (const jschar *it = EscapeNakedForwardSlashes_oldChars;
it < EscapeNakedForwardSlashes_oldChars + EscapeNakedForwardSlashes_oldLen;
++it)
return 0 ? 0 : 0;
}
RegExpFlag CompileRegExpObject_flags = RegExpFlag(0);
RegExpStatics *CompileRegExpObject_res = 0;
static bool CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args) {
RootedAtom source(cx);
RootedAtom escapedSourceStr(cx, EscapeNakedForwardSlashes(cx, source));
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(CompileRegExpObject_flags | CompileRegExpObject_res->getFlags()));
if (!reobj) return false;
}
__attribute__((always_inline)) inline bool IsRegExp(const Value &v) {
return 0 && 0;
}
__attribute__((always_inline)) inline bool regexp_compile_impl(JSContext *cx, CallArgs args) {
RegExpObjectBuilder builder(cx, &args.thisv().toObject().as<RegExpObject>());
return CompileRegExpObject(cx, builder, args);
}
static JSBool regexp_construct(JSContext *cx, unsigned argc, Value *vp) {
return true;
};
RegExpStatics *static_input_getter_res = 0;
static JSBool static_input_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_input_getter_res->createPendingInput(cx, vp);
}
static JSBool static_multiline_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return true;
}
RegExpStatics *static_lastMatch_getter_res = 0;
static JSBool static_lastMatch_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastMatch_getter_res->createLastMatch(cx, vp);
}
RegExpStatics *static_lastParen_getter_res = 0;
static JSBool static_lastParen_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastParen_getter_res->createLastParen(cx, vp);
}
RegExpStatics *static_leftContext_getter_res = 0;
static JSBool static_leftContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_leftContext_getter_res->createLeftContext(cx, vp);
}
RegExpStatics *static_rightContext_getter_res = 0;
static JSBool static_rightContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_rightContext_getter_res->createRightContext(cx, vp);
}
RegExpStatics *static_paren1_getter_res = 0;
static JSBool static_paren1_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren1_getter_res->createParen(cx, 1, vp);
}
RegExpStatics *static_paren2_getter_res = 0;
static JSBool static_paren2_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren2_getter_res->createParen(cx, 2, vp);
}
RegExpStatics *static_paren3_getter_res = 0;
static JSBool static_paren3_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren3_getter_res->createParen(cx, 3, vp);
}
RegExpStatics *static_paren4_getter_res = 0;
static JSBool static_paren4_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren4_getter_res->createParen(cx, 4, vp);
}
RegExpStatics *static_paren5_getter_res = 0;
static JSBool static_paren5_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren5_getter_res->createParen(cx, 5, vp);
}
RegExpStatics *static_paren6_getter_res = 0;
static JSBool static_paren6_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren6_getter_res->createParen(cx, 6, vp);
}
RegExpStatics *static_paren7_getter_res = 0;
static JSBool static_paren7_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren7_getter_res->createParen(cx, 7, vp);
}
RegExpStatics *static_paren8_getter_res = 0;
static JSBool static_paren8_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren8_getter_res->createParen(cx, 8, vp);
}
RegExpStatics *static_paren9_getter_res = 0;
static JSBool static_paren9_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren9_getter_res->createParen(cx, 9, vp);
}
RegExpStatics *static_input_setter_res = 0;
static JSBool static_input_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_input_setter_res->setPendingInput(0);
}
RegExpStatics *static_multiline_setter_res = 0;
static JSBool static_multiline_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_multiline_setter_res->setMultiline(cx, !!0);
}
const uint8_t REGEXP_STATIC_PROP_ATTRS = 0x04 | 0x40 | 0x01;
const uint8_t RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | 0x02;
static const JSPropertySpec regexp_static_props[] = {
"input", 0, REGEXP_STATIC_PROP_ATTRS,
static_input_getter, __null
,
static_input_setter, __null
,
"multiline", 0, REGEXP_STATIC_PROP_ATTRS,
static_multiline_getter, __null
,
static_multiline_setter, __null
, {
"lastMatch", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastMatch_getter, __null
}
, {
"lastParen", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastParen_getter, __null
}
, {
"leftContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_leftContext_getter, __null
}
, {
"rightContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_rightContext_getter, __null
}
, {
"$1", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren1_getter, __null
}
, {
"$2", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren2_getter, __null
}
, {
"$3", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren3_getter, __null
}
, {
"$4", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren4_getter, __null
}
, {
"$5", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren5_getter, __null
}
, {
"$6", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren6_getter, __null
}
, {
"$7", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren7_getter, __null
}
, {
"$8", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren8_getter, __null
}
,
"$9", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren9_getter, __null
};
JSObject * js_InitRegExpClass(JSContext *cx, HandleObject obj) {
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
RootedFunction ctor(cx);
ctor = global->createConstructor(cx, regexp_construct, 0, 2);
return 0;
}
static RegExpRunStatus ExecuteRegExp(JSContext *cx, CallArgs args, MatchConduit &matches) {
RootedObject regexp(cx, &args.thisv().toObject());
RootedString string(cx, 0);
return Trans_NS_js_ExecuteRegExp(cx, regexp, string, matches);
}
static bool regexp_test_impl(JSContext *cx, CallArgs args) {
MatchPair match;
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, args, conduit);
return status != RegExpRunStatus_Error;
}
JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
}
// this should reproduce the crash:
// /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=param-to-global --counter=7 /var/tmp/moz-build-dir/js/src/clang_delta_crash_tmp_fileIPaXzO.ii
-------------- next part --------------
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
extern "C"
extern "C"
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
template<typename T, T Value> struct IntegralConstant {
static const T value = Value;
};
template<typename From, typename To> struct ConvertibleTester {
private: static From create();
template<typename From1, typename To1> static char test(void);
public: static const bool value = sizeof(test<From, To>()) == sizeof(char);
};
template<typename From, typename To> struct IsConvertible : IntegralConstant<bool, ConvertibleTester<From, To>::value> {
};
template<bool B, typename T = void> struct EnableIf;
template<typename T> struct EnableIf<true, T> {
typedef T Type;
};
template<bool Condition, typename A, typename B> struct Conditional {
typedef A Type;
};
template<typename To, typename From> inline To BitwiseCast(void) ;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long int uintptr_t;
typedef int JSBool;
struct JSContext;
namespace JS {
class Value;
template <typename T> class Rooted;
struct Zone;
}
typedef ptrdiff_t jsid;
typedef uint16_t jschar;
typedef enum JSType {
}
JSType;
typedef enum JSProtoKey {
JSProto_LIMIT }
JSGCTraceKind;
typedef struct JSCompartment JSCompartment;
typedef struct JSRuntime JSRuntime;
class JSFunction;
class JSObject;
class JSScript;
class JSString;
namespace JS {
struct Runtime {
};
}
struct ContextFriendFields {
protected: JSRuntime *const runtime_;
JSCompartment *compartment_;
JS::Zone *zone_;
public: JSRuntime * ContextFriendFields_rt;
explicit ContextFriendFields(void) : runtime_(ContextFriendFields_rt), compartment_(__null), zone_(__null) {
}
};
struct PerThreadDataFriendFields {
};
template <typename T> struct GCMethods ;
template <typename T> class RootedBase {
};
template <typename T> class HandleBase {
};
template <typename T> class MutableHandleBase {
};
namespace JS {
template <typename T> class Handle : public HandleBase<T> {
public: template <typename S> Handle( void) ;
static Handle fromMarkedLocation(void) ;
template <typename S> inline Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy = 0);
const T *address() const ;
const T& get() const ;
operator const T&() const ;
T operator->() const ;
private: Handle() ;
const T *ptr;
};
typedef Handle<JSObject*> HandleObject;
typedef Handle<JSScript*> HandleScript;
typedef Handle<JSString*> HandleString;
typedef Handle<jsid> HandleId;
typedef Handle<Value> HandleValue;
template <typename T> class MutableHandle : public MutableHandleBase<T> {
public: ;
T *address() const ;
T get() const ;
operator T() const ;
T *ptr;
};
typedef MutableHandle<Value> MutableHandleValue;
}
template <typename T> struct GCMethods ;
namespace JS {
template <typename T> class Rooted : public RootedBase<T> {
public: Rooted(JSContext *cx ) : ptr(0) {
}
Rooted(JSContext *cx, T initial ) : ptr(initial) {
}
operator const T&() const ;
T operator->() const ;
T &operator=(T value) ;
T ptr;
};
typedef Rooted<JSObject*> RootedObject;
typedef Rooted<JSFunction*> RootedFunction;
typedef Rooted<JSString*> RootedString;
}
enum AllowGC {
};
template <typename T, AllowGC allowGC> class MaybeRooted ;
namespace JS {
template <typename T> template <typename S> inline Handle<T>::Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy) {
}
}
enum JSValueType {
JSVAL_TYPE_BOOLEAN , JSVAL_TYPE_STRING , JSVAL_TYPE_NULL , JSVAL_TYPE_OBJECT }
__attribute__((packed));
enum JSValueTag {
JSVAL_TAG_MAX_DOUBLE , JSVAL_TAG_STRING , JSVAL_TAG_BOOLEAN , JSVAL_TAG_NULL , JSVAL_TAG_OBJECT }
__attribute__((packed));
enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_NULL }
JSWhyMagic;
typedef union jsval_layout {
uint64_t asBits;
}
__attribute__((aligned )) jsval_layout;
jsval_layout JSVAL_IS_STRING_IMPL_l;
static inline JSBool JSVAL_IS_STRING_IMPL(void) {
return JSVAL_IS_STRING_IMPL_l.asBits >> 47 == JSVAL_TAG_STRING;
}
jsval_layout JSVAL_TO_STRING_IMPL_l;
static inline JSString * JSVAL_TO_STRING_IMPL(void) {
return (JSString *)(JSVAL_TO_STRING_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL);
}
jsval_layout JSVAL_IS_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_IS_BOOLEAN_IMPL(void) {
return JSVAL_IS_BOOLEAN_IMPL_l.asBits >> 47 == JSVAL_TAG_BOOLEAN;
}
jsval_layout JSVAL_TO_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_TO_BOOLEAN_IMPL(void) {
return JSVAL_TO_BOOLEAN_IMPL_l.asBits;
}
jsval_layout JSVAL_IS_OBJECT_IMPL_l;
static inline JSBool JSVAL_IS_OBJECT_IMPL(void) {
return JSVAL_IS_OBJECT_IMPL_l.asBits >= JSVAL_SHIFTED_TAG_NULL;
}
jsval_layout JSVAL_TO_OBJECT_IMPL_l;
static inline JSObject * JSVAL_TO_OBJECT_IMPL(void) {
uint64_t ptrBits = JSVAL_TO_OBJECT_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL;
return (JSObject *)ptrBits;
}
static inline jsval_layout JSVAL_TO_IMPL(void);
namespace JS {
class Value {
public:
bool isObject() const ;
JSObject &toObject() const ;
private: jsval_layout data;
friend jsval_layout (::JSVAL_TO_IMPL)(void);
};
}
template <class Outer> class ValueOperations {
const JS::Value * value() const ;
public:
JSObject &toObject() const ;
};
template <> class HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> > {
friend class ValueOperations;
const JS::Value * extract() const ;
};
JS::Value JSVAL_TO_IMPL_v;
inline jsval_layout JSVAL_TO_IMPL(void) {
return JSVAL_TO_IMPL_v.data;
}
typedef JS::Value jsval;
static inline JSBool JSVAL_IS_STRING(jsval v) {
return 0;
}
static inline JSString * JSVAL_TO_STRING(jsval v) {
return 0;
}
static inline JSBool JSVAL_IS_BOOLEAN(jsval v) {
return 0;
}
static inline JSBool JSVAL_TO_BOOLEAN(jsval v) {
return 0;
}
typedef JSBool (* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);
namespace JS {
enum UsedRval {
IncludeUsedRval, NoUsedRval };
template<UsedRval WantUsedRval> class UsedRvalBase;
template<> class UsedRvalBase<NoUsedRval> {
};
template<UsedRval WantUsedRval> class CallReceiverBase : public UsedRvalBase< NoUsedRval > {
protected: Value *argv_;
public:
HandleValue thisv() const ;
};
class CallReceiver : public CallReceiverBase<IncludeUsedRval> {
};
template<UsedRval WantUsedRval> class CallArgsBase : public Conditional<WantUsedRval == IncludeUsedRval, CallReceiver, CallReceiverBase<NoUsedRval> >::Type {
protected: unsigned argc_;
public: unsigned length() const ;
HandleValue handleOrUndefinedAt(unsigned i) const ;
};
class CallArgs : public CallArgsBase<IncludeUsedRval> {
private: friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);
static CallArgs create(unsigned argc, Value *argv) ;
};
__attribute__((always_inline)) inline CallArgs CallArgsFromVp(unsigned argc, Value *vp) {
return CallArgs::create(argc, vp + 2);
}
}
template <class T, size_t N, class AP, bool IsPod> struct VectorImpl ;
template <class T, size_t N, class AllocPolicy> class Vector : private AllocPolicy {
size_t mLength;
public: static const size_t sMaxInlineStorage = N;
Vector(AllocPolicy = AllocPolicy());
bool empty() const ;
};
namespace JS {
class __attribute__((visibility("default"))) AutoGCRooter ;
typedef bool (*IsAcceptableThis)(const Value &v);
typedef bool (*NativeImpl)(JSContext *cx, CallArgs args);
extern __attribute__((visibility("default"))) bool CallMethodIfWrapped;
template<IsAcceptableThis Test, NativeImpl Impl> __attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, CallArgs args) ;
__attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args) {
const Value &thisv = args.thisv();
if (Test(thisv)) return 0;
return 0;
}
}
typedef JSBool (* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
typedef JSBool (* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);
extern __attribute__((visibility("default"))) JSBool JS_ConvertValue;
namespace JS {
}
typedef struct JSJitInfo JSJitInfo;
typedef struct JSStrictPropertyOpWrapper {
JSStrictPropertyOp op;
const JSJitInfo *info;
}
JSStrictPropertyOpWrapper;
typedef struct JSPropertyOpWrapper {
JSPropertyOp op;
const JSJitInfo *info;
}
JSPropertyOpWrapper;
struct JSPropertySpec {
const char *name;
int8_t tinyid;
uint8_t flags;
JSPropertyOpWrapper getter;
JSStrictPropertyOpWrapper setter;
};
using JS::Value;
using JS::CallArgs;
using JS::Rooted;
using JS::RootedObject;
using JS::RootedFunction;
using JS::RootedString;
using JS::Handle;
using JS::HandleObject;
using JS::HandleString;
using JS::HandleId;
using JS::MutableHandleValue;
typedef uint8_t jsbytecode;
class JSAtom;
class RegExpObject;
class RegExpStatics;
enum RegExpFlag {
};
class FrameRegs;
class GlobalObject;
class Shape;
struct TypeObject;
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Rooted<JSAtom*> RootedAtom;
struct MatchPair {
};
struct MatchConduit {
explicit MatchConduit(MatchPair *pair) ;
};
template<typename T> class LinkedListElement {
};
class SpecialId ;
struct Class ;
struct BaseShape ;
class Trans_NS_shadow_Shape ;
struct Object ;
namespace JS {
struct ArenaHeader {
};
}
struct ArenaHeader;
struct Chunk;
enum AllocKind {
FINALIZE_OBJECT4_BACKGROUND, FINALIZE_IONCODE, FINALIZE_LAST };
struct Cell {
public: inline ArenaHeader *arenaHeader() const;
__attribute__((always_inline)) inline void unmark(uint32_t color) const;
protected: inline uintptr_t address() const;
inline Chunk *chunk() const;
uintptr_t first;
uintptr_t last;
static size_t encodeOffsets ;
uintptr_t arenaAddress() const ;
};
struct ArenaHeader : public JS::ArenaHeader {
size_t allocKind : 8;
;
private: static __attribute__((visibility("default"))) const uint32_t ThingSizes[];
};
static void AssertValidColor(const void *thing, uint32_t color) {
}
void Cell::unmark(uint32_t color) const {
AssertValidColor(this, color);
}
template<class T, typename Unioned = uintptr_t> class EncapsulatedPtr {
protected: union {
T *value;
};
public:
T *operator->() const ;
operator T*() const ;
};
template <class T, class Unioned = uintptr_t> class HeapPtr : public EncapsulatedPtr<T, Unioned> {
};
template <class T> class FixedHeapPtr {
T *value;
public: operator T*() const ;
};
typedef HeapPtr<JSObject> HeapPtrObject;
typedef HeapPtr<TypeObject> HeapPtrTypeObject;
class EncapsulatedValue : public ValueOperations<EncapsulatedValue> {
protected: Value value;
public:
operator const Value &() const ;
};
class HeapSlot : public EncapsulatedValue {
};
template<class T> class ReadBarriered ;;
struct TypeObjectKey ;
class Type ;
struct TypeNewScript ;
struct TypeObject : Cell {
Class *clasp;
HeapPtrObject proto;
};
template <AllowGC allowGC> extern JSString * ToStringSlow(JSContext *cx, typename MaybeRooted<Value, allowGC>::HandleType arg);
template <AllowGC allowGC> static __attribute__((always_inline)) inline JSString * ToString(JSContext *cx, JS::HandleValue v) ;
class JSString : public Cell {
protected: static const size_t NUM_INLINE_CHARS = 2 * sizeof(void *) / sizeof(jschar);
struct Data {
size_t lengthAndFlags;
union {
const jschar *chars;
}
u1;
}
d;
public: static const size_t LENGTH_SHIFT = 4;
public: __attribute__((always_inline)) inline size_t length() const ;
};
class JSLinearString : public JSString {
public: __attribute__((always_inline)) inline const jschar *chars() const ;
};
class JSFlatString : public JSLinearString {
};
class JSAtom : public JSFlatString {
};
class PropertyName : public JSAtom {
};
class ObjectImpl : public Cell {
HeapPtrTypeObject type_;
public:
Class *getClass() const ;
HeapSlot *fixedSlots() const ;
uint32_t numFixedSlots() const ;
const Value &getSlot(uint32_t slot) const ;
inline void *&privateRef(uint32_t nfixed) const ;
inline void *getPrivate() const {
return 0;
}
};
class JSObject : public ObjectImpl {
public: ;
template <class T> inline bool is() const ;
template <class T> T &as() ;
};
class JSFunction : public JSObject {
public: static Class class_;
union U {
struct Scripted {
union
s;
}
i;
}
u;
JSScript *nonLazyScript() const ;
static const AllocKind FinalizeKind = FINALIZE_OBJECT4_BACKGROUND;
};
class StackFrame ;
class InterpreterActivation;
class Activation {
protected: JSContext *cx_;
public:
InterpreterActivation *asInterpreter() const ;
};
class InterpreterActivation : public Activation {
StackFrame *current_;
public: ;
};
struct JSAtomState {
FixedHeapPtr<PropertyName> RegExp;
};
class PerThreadData : public PerThreadDataFriendFields {
public: uint8_t *ionTop;
Activation *activation_;
};
template<class Client> struct MallocProvider {
};
struct JSRuntime : public JS::Runtime, public MallocProvider<JSRuntime> {
PerThreadData mainThread;
union {
JSAtomState atomState;
};
};
struct ThreadSafeContext : ContextFriendFields, public MallocProvider<ThreadSafeContext> {
};
struct JSContext : ThreadSafeContext, public LinkedListElement<JSContext> {
JSRuntime *runtime() const ;
JSCompartment *compartment() const ;
inline Handle<GlobalObject*> global() const;
inline RegExpStatics *regExpStatics();
enum MaybeAllowCrossCompartment {
};
;
JSAtomState & names() ;
};
class ContextAllocPolicy ;;
enum RegExpRunStatus {
RegExpRunStatus_Error, RegExpRunStatus_Success_NotFound };
class RegExpObjectBuilder {
public: RegExpObjectBuilder(JSContext *cx, RegExpObject *reobj = __null);
RegExpObject *build(HandleAtom source, RegExpFlag flags);
};
class RegExpObject : public JSObject {
public: static const unsigned RESERVED_SLOTS = 6;
static Class class_;
};
RegExpRunStatus Trans_NS_js_ExecuteRegExp(JSContext *cx, HandleObject regexp, HandleString string, MatchConduit &matches);
extern JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp);
class StringBuffer ;
class GlobalObject : public JSObject {
static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 3;
static const unsigned EVAL = STANDARD_CLASS_SLOTS;
static const unsigned CREATE_DATAVIEW_FOR_THIS = EVAL + 1;
static const unsigned THROWTYPEERROR = CREATE_DATAVIEW_FOR_THIS + 1;
static const unsigned PROTO_GETTER = THROWTYPEERROR + 1;
static const unsigned FROM_BUFFER_UINT8 = PROTO_GETTER + 1;
static const unsigned FROM_BUFFER_INT8 = FROM_BUFFER_UINT8 + 1;
static const unsigned FROM_BUFFER_UINT16 = FROM_BUFFER_INT8 + 1;
static const unsigned FROM_BUFFER_INT16 = FROM_BUFFER_UINT16 + 1;
static const unsigned FROM_BUFFER_UINT32 = FROM_BUFFER_INT16 + 1;
static const unsigned FROM_BUFFER_INT32 = FROM_BUFFER_UINT32 + 1;
static const unsigned FROM_BUFFER_FLOAT32 = FROM_BUFFER_INT32 + 1;
static const unsigned FROM_BUFFER_FLOAT64 = FROM_BUFFER_FLOAT32 + 1;
static const unsigned FROM_BUFFER_UINT8CLAMPED = FROM_BUFFER_FLOAT64 + 1;
static const unsigned ELEMENT_ITERATOR_PROTO = FROM_BUFFER_UINT8CLAMPED + 1;
static const unsigned GENERATOR_PROTO = ELEMENT_ITERATOR_PROTO + 1;
static const unsigned MAP_ITERATOR_PROTO = GENERATOR_PROTO + 1;
static const unsigned SET_ITERATOR_PROTO = MAP_ITERATOR_PROTO + 1;
static const unsigned COLLATOR_PROTO = SET_ITERATOR_PROTO + 1;
static const unsigned NUMBER_FORMAT_PROTO = COLLATOR_PROTO + 1;
static const unsigned DATE_TIME_FORMAT_PROTO = NUMBER_FORMAT_PROTO + 1;
static const unsigned REGEXP_STATICS = DATE_TIME_FORMAT_PROTO + 1;
public: ;
JSFunction * createConstructor(JSContext *cx, JSNative ctor, JSAtom *name, unsigned length, AllocKind kind = JSFunction::FinalizeKind);
JSObject *createBlankPrototype;
inline RegExpStatics *getRegExpStatics() const;
};
struct JSCompartment ;
inline Handle<GlobalObject*> JSContext::global() const {
return Handle<GlobalObject*>::fromMarkedLocation();
}
class RegExpStatics {
RegExpFlag flags;
RegExpStatics *bufferLink;
bool copied;
public:
inline void setMultiline(JSContext *cx, bool enabled);
inline void setPendingInput(JSString *newInput);
RegExpFlag getFlags() const ;
bool createPendingInput(JSContext *cx, MutableHandleValue out);
bool createLastMatch(JSContext *cx, MutableHandleValue out);
bool createLastParen(JSContext *cx, MutableHandleValue out);
bool createParen(JSContext *cx, size_t pairNum, MutableHandleValue out);
bool createLeftContext(JSContext *cx, MutableHandleValue out);
bool createRightContext(JSContext *cx, MutableHandleValue out);
};
inline RegExpStatics * GlobalObject::getRegExpStatics() const {
JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
return static_cast<RegExpStatics *>(resObj.getPrivate());
}
inline void RegExpStatics::setPendingInput(JSString *newInput) {
}
inline void RegExpStatics::setMultiline(JSContext *cx, bool enabled) {
}
inline RegExpStatics * JSContext::regExpStatics() {
return 0;
}
size_t EscapeNakedForwardSlashes_oldLen = 0;
const jschar *EscapeNakedForwardSlashes_oldChars = 0;
static JSAtom * EscapeNakedForwardSlashes(JSContext *cx, HandleAtom unescaped) {
for (const jschar *it = EscapeNakedForwardSlashes_oldChars;
it < EscapeNakedForwardSlashes_oldChars + EscapeNakedForwardSlashes_oldLen;
++it)
return 0 ? 0 : 0;
}
RegExpFlag CompileRegExpObject_flags = RegExpFlag(0);
RegExpStatics *CompileRegExpObject_res = 0;
static bool CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args) {
RootedAtom source(cx);
RootedAtom escapedSourceStr(cx, EscapeNakedForwardSlashes(cx, source));
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(CompileRegExpObject_flags | CompileRegExpObject_res->getFlags()));
if (!reobj) return false;
}
__attribute__((always_inline)) inline bool IsRegExp(const Value &v) {
return 0 && 0;
}
__attribute__((always_inline)) inline bool regexp_compile_impl(JSContext *cx, CallArgs args) {
RegExpObjectBuilder builder(cx, &args.thisv().toObject().as<RegExpObject>());
return CompileRegExpObject(cx, builder, args);
}
static JSBool regexp_construct(JSContext *cx, unsigned argc, Value *vp) {
return true;
};
RegExpStatics *static_input_getter_res = 0;
static JSBool static_input_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_input_getter_res->createPendingInput(cx, vp);
}
static JSBool static_multiline_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return true;
}
RegExpStatics *static_lastMatch_getter_res = 0;
static JSBool static_lastMatch_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastMatch_getter_res->createLastMatch(cx, vp);
}
RegExpStatics *static_lastParen_getter_res = 0;
static JSBool static_lastParen_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastParen_getter_res->createLastParen(cx, vp);
}
RegExpStatics *static_leftContext_getter_res = 0;
static JSBool static_leftContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_leftContext_getter_res->createLeftContext(cx, vp);
}
RegExpStatics *static_rightContext_getter_res = 0;
static JSBool static_rightContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_rightContext_getter_res->createRightContext(cx, vp);
}
RegExpStatics *static_paren1_getter_res = 0;
static JSBool static_paren1_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren1_getter_res->createParen(cx, 1, vp);
}
RegExpStatics *static_paren2_getter_res = 0;
static JSBool static_paren2_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren2_getter_res->createParen(cx, 2, vp);
}
RegExpStatics *static_paren3_getter_res = 0;
static JSBool static_paren3_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren3_getter_res->createParen(cx, 3, vp);
}
RegExpStatics *static_paren4_getter_res = 0;
static JSBool static_paren4_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren4_getter_res->createParen(cx, 4, vp);
}
RegExpStatics *static_paren5_getter_res = 0;
static JSBool static_paren5_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren5_getter_res->createParen(cx, 5, vp);
}
RegExpStatics *static_paren6_getter_res = 0;
static JSBool static_paren6_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren6_getter_res->createParen(cx, 6, vp);
}
RegExpStatics *static_paren7_getter_res = 0;
static JSBool static_paren7_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren7_getter_res->createParen(cx, 7, vp);
}
RegExpStatics *static_paren8_getter_res = 0;
static JSBool static_paren8_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren8_getter_res->createParen(cx, 8, vp);
}
RegExpStatics *static_paren9_getter_res = 0;
static JSBool static_paren9_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren9_getter_res->createParen(cx, 9, vp);
}
RegExpStatics *static_input_setter_res = 0;
static JSBool static_input_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_input_setter_res->setPendingInput(0);
}
RegExpStatics *static_multiline_setter_res = 0;
static JSBool static_multiline_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_multiline_setter_res->setMultiline(cx, !!0);
}
const uint8_t REGEXP_STATIC_PROP_ATTRS = 0x04 | 0x40 | 0x01;
const uint8_t RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | 0x02;
static const JSPropertySpec regexp_static_props[] = {
"input", 0, REGEXP_STATIC_PROP_ATTRS,
static_input_getter, __null
,
static_input_setter, __null
,
"multiline", 0, REGEXP_STATIC_PROP_ATTRS,
static_multiline_getter, __null
,
static_multiline_setter, __null
, {
"lastMatch", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastMatch_getter, __null
}
, {
"lastParen", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastParen_getter, __null
}
, {
"leftContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_leftContext_getter, __null
}
, {
"rightContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_rightContext_getter, __null
}
, {
"$1", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren1_getter, __null
}
, {
"$2", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren2_getter, __null
}
, {
"$3", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren3_getter, __null
}
, {
"$4", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren4_getter, __null
}
, {
"$5", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren5_getter, __null
}
, {
"$6", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren6_getter, __null
}
, {
"$7", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren7_getter, __null
}
, {
"$8", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren8_getter, __null
}
,
"$9", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren9_getter, __null
};
JSObject * js_InitRegExpClass(JSContext *cx, HandleObject obj) {
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
RootedFunction ctor(cx);
ctor = global->createConstructor(cx, regexp_construct, 0, 2);
return 0;
}
static RegExpRunStatus ExecuteRegExp(JSContext *cx, CallArgs args, MatchConduit &matches) {
RootedObject regexp(cx, &args.thisv().toObject());
RootedString string(cx, 0);
return Trans_NS_js_ExecuteRegExp(cx, regexp, string, matches);
}
static bool regexp_test_impl(JSContext *cx, CallArgs args) {
MatchPair match;
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, args, conduit);
return status != RegExpRunStatus_Error;
}
JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
}
// this should reproduce the crash:
// /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=param-to-global --counter=10 /var/tmp/moz-build-dir/js/src/clang_delta_crash_tmp_fileUQ1An2.ii
-------------- next part --------------
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
extern "C"
extern "C"
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
template<typename T, T Value> struct IntegralConstant {
static const T value = Value;
};
template<typename From, typename To> struct ConvertibleTester {
private: static From create();
template<typename From1, typename To1> static char test(void);
public: static const bool value = sizeof(test<From, To>()) == sizeof(char);
};
template<typename From, typename To> struct IsConvertible : IntegralConstant<bool, ConvertibleTester<From, To>::value> {
};
template<bool B, typename T = void> struct EnableIf;
template<typename T> struct EnableIf<true, T> {
typedef T Type;
};
template<bool Condition, typename A, typename B> struct Conditional {
typedef A Type;
};
template<typename To, typename From> inline To BitwiseCast(void) ;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long int uintptr_t;
typedef int JSBool;
struct JSContext;
namespace JS {
class Value;
template <typename T> class Rooted;
struct Zone;
}
typedef ptrdiff_t jsid;
typedef uint16_t jschar;
typedef enum JSType {
}
JSType;
typedef enum JSProtoKey {
JSProto_LIMIT }
JSGCTraceKind;
typedef struct JSCompartment JSCompartment;
typedef struct JSRuntime JSRuntime;
class JSFunction;
class JSObject;
class JSScript;
class JSString;
namespace JS {
struct Runtime {
};
}
struct ContextFriendFields {
protected: JSRuntime *const runtime_;
JSCompartment *compartment_;
JS::Zone *zone_;
public: JSRuntime * ContextFriendFields_rt;
explicit ContextFriendFields(void) : runtime_(ContextFriendFields_rt), compartment_(__null), zone_(__null) {
}
};
struct PerThreadDataFriendFields {
};
template <typename T> struct GCMethods ;
template <typename T> class RootedBase {
};
template <typename T> class HandleBase {
};
template <typename T> class MutableHandleBase {
};
namespace JS {
template <typename T> class Handle : public HandleBase<T> {
public: template <typename S> Handle( void) ;
static Handle fromMarkedLocation(void) ;
template <typename S> inline Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy = 0);
const T *address() const ;
const T& get() const ;
operator const T&() const ;
T operator->() const ;
private: Handle() ;
const T *ptr;
};
typedef Handle<JSObject*> HandleObject;
typedef Handle<JSScript*> HandleScript;
typedef Handle<JSString*> HandleString;
typedef Handle<jsid> HandleId;
typedef Handle<Value> HandleValue;
template <typename T> class MutableHandle : public MutableHandleBase<T> {
public: ;
T *address() const ;
T get() const ;
operator T() const ;
T *ptr;
};
typedef MutableHandle<Value> MutableHandleValue;
}
template <typename T> struct GCMethods ;
namespace JS {
template <typename T> class Rooted : public RootedBase<T> {
public: Rooted(JSContext *cx ) : ptr(0) {
}
Rooted(JSContext *cx, T initial ) : ptr(initial) {
}
operator const T&() const ;
T operator->() const ;
T &operator=(T value) ;
T ptr;
};
typedef Rooted<JSObject*> RootedObject;
typedef Rooted<JSFunction*> RootedFunction;
typedef Rooted<JSString*> RootedString;
}
enum AllowGC {
};
template <typename T, AllowGC allowGC> class MaybeRooted ;
namespace JS {
template <typename T> template <typename S> inline Handle<T>::Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy) {
}
}
enum JSValueType {
JSVAL_TYPE_BOOLEAN , JSVAL_TYPE_STRING , JSVAL_TYPE_NULL , JSVAL_TYPE_OBJECT }
__attribute__((packed));
enum JSValueTag {
JSVAL_TAG_MAX_DOUBLE , JSVAL_TAG_STRING , JSVAL_TAG_BOOLEAN , JSVAL_TAG_NULL , JSVAL_TAG_OBJECT }
__attribute__((packed));
enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_NULL }
JSWhyMagic;
typedef union jsval_layout {
uint64_t asBits;
}
__attribute__((aligned )) jsval_layout;
jsval_layout JSVAL_IS_STRING_IMPL_l;
static inline JSBool JSVAL_IS_STRING_IMPL(void) {
return JSVAL_IS_STRING_IMPL_l.asBits >> 47 == JSVAL_TAG_STRING;
}
jsval_layout JSVAL_TO_STRING_IMPL_l;
static inline JSString * JSVAL_TO_STRING_IMPL(void) {
return (JSString *)(JSVAL_TO_STRING_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL);
}
jsval_layout JSVAL_IS_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_IS_BOOLEAN_IMPL(void) {
return JSVAL_IS_BOOLEAN_IMPL_l.asBits >> 47 == JSVAL_TAG_BOOLEAN;
}
jsval_layout JSVAL_TO_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_TO_BOOLEAN_IMPL(void) {
return JSVAL_TO_BOOLEAN_IMPL_l.asBits;
}
jsval_layout JSVAL_IS_OBJECT_IMPL_l;
static inline JSBool JSVAL_IS_OBJECT_IMPL(void) {
return JSVAL_IS_OBJECT_IMPL_l.asBits >= JSVAL_SHIFTED_TAG_NULL;
}
jsval_layout JSVAL_TO_OBJECT_IMPL_l;
static inline JSObject * JSVAL_TO_OBJECT_IMPL(void) {
uint64_t ptrBits = JSVAL_TO_OBJECT_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL;
return (JSObject *)ptrBits;
}
static inline jsval_layout JSVAL_TO_IMPL(void);
namespace JS {
class Value {
public:
bool isObject() const ;
JSObject &toObject() const ;
private: jsval_layout data;
friend jsval_layout (::JSVAL_TO_IMPL)(void);
};
}
template <class Outer> class ValueOperations {
const JS::Value * value() const ;
public:
JSObject &toObject() const ;
};
template <> class HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> > {
friend class ValueOperations;
const JS::Value * extract() const ;
};
JS::Value JSVAL_TO_IMPL_v;
inline jsval_layout JSVAL_TO_IMPL(void) {
return JSVAL_TO_IMPL_v.data;
}
typedef JS::Value jsval;
jsval JSVAL_IS_STRING_v;
static inline JSBool JSVAL_IS_STRING(void) {
return 0;
}
jsval JSVAL_TO_STRING_v;
static inline JSString * JSVAL_TO_STRING(void) {
return 0;
}
jsval JSVAL_IS_BOOLEAN_v;
static inline JSBool JSVAL_IS_BOOLEAN(void) {
return 0;
}
jsval JSVAL_TO_BOOLEAN_v;
static inline JSBool JSVAL_TO_BOOLEAN(void) {
return 0;
}
typedef JSBool (* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);
namespace JS {
enum UsedRval {
IncludeUsedRval, NoUsedRval };
template<UsedRval WantUsedRval> class UsedRvalBase;
template<> class UsedRvalBase<NoUsedRval> {
};
template<UsedRval WantUsedRval> class CallReceiverBase : public UsedRvalBase< NoUsedRval > {
protected: Value *argv_;
public:
HandleValue thisv() const ;
};
class CallReceiver : public CallReceiverBase<IncludeUsedRval> {
};
template<UsedRval WantUsedRval> class CallArgsBase : public Conditional<WantUsedRval == IncludeUsedRval, CallReceiver, CallReceiverBase<NoUsedRval> >::Type {
protected: unsigned argc_;
public: unsigned length() const ;
HandleValue handleOrUndefinedAt(unsigned i) const ;
};
class CallArgs : public CallArgsBase<IncludeUsedRval> {
private: friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);
static CallArgs create(unsigned argc, Value *argv) ;
};
__attribute__((always_inline)) inline CallArgs CallArgsFromVp(unsigned argc, Value *vp) {
return CallArgs::create(argc, vp + 2);
}
}
template <class T, size_t N, class AP, bool IsPod> struct VectorImpl ;
template <class T, size_t N, class AllocPolicy> class Vector : private AllocPolicy {
size_t mLength;
public: static const size_t sMaxInlineStorage = N;
Vector(AllocPolicy = AllocPolicy());
bool empty() const ;
};
namespace JS {
class __attribute__((visibility("default"))) AutoGCRooter ;
typedef bool (*IsAcceptableThis)(const Value &v);
typedef bool (*NativeImpl)(JSContext *cx, CallArgs args);
extern __attribute__((visibility("default"))) bool CallMethodIfWrapped;
template<IsAcceptableThis Test, NativeImpl Impl> __attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, CallArgs args) ;
__attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args) {
const Value &thisv = args.thisv();
if (Test(thisv)) return 0;
return 0;
}
}
typedef JSBool (* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
typedef JSBool (* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);
extern __attribute__((visibility("default"))) JSBool JS_ConvertValue;
namespace JS {
}
typedef struct JSJitInfo JSJitInfo;
typedef struct JSStrictPropertyOpWrapper {
JSStrictPropertyOp op;
const JSJitInfo *info;
}
JSStrictPropertyOpWrapper;
typedef struct JSPropertyOpWrapper {
JSPropertyOp op;
const JSJitInfo *info;
}
JSPropertyOpWrapper;
struct JSPropertySpec {
const char *name;
int8_t tinyid;
uint8_t flags;
JSPropertyOpWrapper getter;
JSStrictPropertyOpWrapper setter;
};
using JS::Value;
using JS::CallArgs;
using JS::Rooted;
using JS::RootedObject;
using JS::RootedFunction;
using JS::RootedString;
using JS::Handle;
using JS::HandleObject;
using JS::HandleString;
using JS::HandleId;
using JS::MutableHandleValue;
typedef uint8_t jsbytecode;
class JSAtom;
class RegExpObject;
class RegExpStatics;
enum RegExpFlag {
};
class FrameRegs;
class GlobalObject;
class Shape;
struct TypeObject;
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Rooted<JSAtom*> RootedAtom;
struct MatchPair {
};
struct MatchConduit {
explicit MatchConduit(MatchPair *pair) ;
};
template<typename T> class LinkedListElement {
};
class SpecialId ;
struct Class ;
struct BaseShape ;
class Trans_NS_shadow_Shape ;
struct Object ;
namespace JS {
struct ArenaHeader {
};
}
struct ArenaHeader;
struct Chunk;
enum AllocKind {
FINALIZE_OBJECT4_BACKGROUND, FINALIZE_IONCODE, FINALIZE_LAST };
struct Cell {
public: inline ArenaHeader *arenaHeader() const;
__attribute__((always_inline)) inline void unmark(uint32_t color) const;
protected: inline uintptr_t address() const;
inline Chunk *chunk() const;
uintptr_t first;
uintptr_t last;
static size_t encodeOffsets ;
uintptr_t arenaAddress() const ;
};
struct ArenaHeader : public JS::ArenaHeader {
size_t allocKind : 8;
;
private: static __attribute__((visibility("default"))) const uint32_t ThingSizes[];
};
static void AssertValidColor(const void *thing, uint32_t color) {
}
void Cell::unmark(uint32_t color) const {
AssertValidColor(this, color);
}
template<class T, typename Unioned = uintptr_t> class EncapsulatedPtr {
protected: union {
T *value;
};
public:
T *operator->() const ;
operator T*() const ;
};
template <class T, class Unioned = uintptr_t> class HeapPtr : public EncapsulatedPtr<T, Unioned> {
};
template <class T> class FixedHeapPtr {
T *value;
public: operator T*() const ;
};
typedef HeapPtr<JSObject> HeapPtrObject;
typedef HeapPtr<TypeObject> HeapPtrTypeObject;
class EncapsulatedValue : public ValueOperations<EncapsulatedValue> {
protected: Value value;
public:
operator const Value &() const ;
};
class HeapSlot : public EncapsulatedValue {
};
template<class T> class ReadBarriered ;;
struct TypeObjectKey ;
class Type ;
struct TypeNewScript ;
struct TypeObject : Cell {
Class *clasp;
HeapPtrObject proto;
};
template <AllowGC allowGC> extern JSString * ToStringSlow(JSContext *cx, typename MaybeRooted<Value, allowGC>::HandleType arg);
template <AllowGC allowGC> static __attribute__((always_inline)) inline JSString * ToString(JSContext *cx, JS::HandleValue v) ;
class JSString : public Cell {
protected: static const size_t NUM_INLINE_CHARS = 2 * sizeof(void *) / sizeof(jschar);
struct Data {
size_t lengthAndFlags;
union {
const jschar *chars;
}
u1;
}
d;
public: static const size_t LENGTH_SHIFT = 4;
public: __attribute__((always_inline)) inline size_t length() const ;
};
class JSLinearString : public JSString {
public: __attribute__((always_inline)) inline const jschar *chars() const ;
};
class JSFlatString : public JSLinearString {
};
class JSAtom : public JSFlatString {
};
class PropertyName : public JSAtom {
};
class ObjectImpl : public Cell {
HeapPtrTypeObject type_;
public:
Class *getClass() const ;
HeapSlot *fixedSlots() const ;
uint32_t numFixedSlots() const ;
const Value &getSlot(uint32_t slot) const ;
inline void *&privateRef(uint32_t nfixed) const ;
inline void *getPrivate() const {
return 0;
}
};
class JSObject : public ObjectImpl {
public: ;
template <class T> inline bool is() const ;
template <class T> T &as() ;
};
class JSFunction : public JSObject {
public: static Class class_;
union U {
struct Scripted {
union
s;
}
i;
}
u;
JSScript *nonLazyScript() const ;
static const AllocKind FinalizeKind = FINALIZE_OBJECT4_BACKGROUND;
};
class StackFrame ;
class InterpreterActivation;
class Activation {
protected: JSContext *cx_;
public:
InterpreterActivation *asInterpreter() const ;
};
class InterpreterActivation : public Activation {
StackFrame *current_;
public: ;
};
struct JSAtomState {
FixedHeapPtr<PropertyName> RegExp;
};
class PerThreadData : public PerThreadDataFriendFields {
public: uint8_t *ionTop;
Activation *activation_;
};
template<class Client> struct MallocProvider {
};
struct JSRuntime : public JS::Runtime, public MallocProvider<JSRuntime> {
PerThreadData mainThread;
union {
JSAtomState atomState;
};
};
struct ThreadSafeContext : ContextFriendFields, public MallocProvider<ThreadSafeContext> {
};
struct JSContext : ThreadSafeContext, public LinkedListElement<JSContext> {
JSRuntime *runtime() const ;
JSCompartment *compartment() const ;
inline Handle<GlobalObject*> global() const;
inline RegExpStatics *regExpStatics();
enum MaybeAllowCrossCompartment {
};
;
JSAtomState & names() ;
};
class ContextAllocPolicy ;;
enum RegExpRunStatus {
RegExpRunStatus_Error, RegExpRunStatus_Success_NotFound };
class RegExpObjectBuilder {
public: RegExpObjectBuilder(JSContext *cx, RegExpObject *reobj = __null);
RegExpObject *build(HandleAtom source, RegExpFlag flags);
};
class RegExpObject : public JSObject {
public: static const unsigned RESERVED_SLOTS = 6;
static Class class_;
};
RegExpRunStatus Trans_NS_js_ExecuteRegExp(JSContext *cx, HandleObject regexp, HandleString string, MatchConduit &matches);
extern JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp);
class StringBuffer ;
class GlobalObject : public JSObject {
static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 3;
static const unsigned EVAL = STANDARD_CLASS_SLOTS;
static const unsigned CREATE_DATAVIEW_FOR_THIS = EVAL + 1;
static const unsigned THROWTYPEERROR = CREATE_DATAVIEW_FOR_THIS + 1;
static const unsigned PROTO_GETTER = THROWTYPEERROR + 1;
static const unsigned FROM_BUFFER_UINT8 = PROTO_GETTER + 1;
static const unsigned FROM_BUFFER_INT8 = FROM_BUFFER_UINT8 + 1;
static const unsigned FROM_BUFFER_UINT16 = FROM_BUFFER_INT8 + 1;
static const unsigned FROM_BUFFER_INT16 = FROM_BUFFER_UINT16 + 1;
static const unsigned FROM_BUFFER_UINT32 = FROM_BUFFER_INT16 + 1;
static const unsigned FROM_BUFFER_INT32 = FROM_BUFFER_UINT32 + 1;
static const unsigned FROM_BUFFER_FLOAT32 = FROM_BUFFER_INT32 + 1;
static const unsigned FROM_BUFFER_FLOAT64 = FROM_BUFFER_FLOAT32 + 1;
static const unsigned FROM_BUFFER_UINT8CLAMPED = FROM_BUFFER_FLOAT64 + 1;
static const unsigned ELEMENT_ITERATOR_PROTO = FROM_BUFFER_UINT8CLAMPED + 1;
static const unsigned GENERATOR_PROTO = ELEMENT_ITERATOR_PROTO + 1;
static const unsigned MAP_ITERATOR_PROTO = GENERATOR_PROTO + 1;
static const unsigned SET_ITERATOR_PROTO = MAP_ITERATOR_PROTO + 1;
static const unsigned COLLATOR_PROTO = SET_ITERATOR_PROTO + 1;
static const unsigned NUMBER_FORMAT_PROTO = COLLATOR_PROTO + 1;
static const unsigned DATE_TIME_FORMAT_PROTO = NUMBER_FORMAT_PROTO + 1;
static const unsigned REGEXP_STATICS = DATE_TIME_FORMAT_PROTO + 1;
public: ;
JSFunction * createConstructor(JSContext *cx, JSNative ctor, JSAtom *name, unsigned length, AllocKind kind = JSFunction::FinalizeKind);
JSObject *createBlankPrototype;
inline RegExpStatics *getRegExpStatics() const;
};
struct JSCompartment ;
inline Handle<GlobalObject*> JSContext::global() const {
return Handle<GlobalObject*>::fromMarkedLocation();
}
class RegExpStatics {
RegExpFlag flags;
RegExpStatics *bufferLink;
bool copied;
public:
inline void setMultiline(JSContext *cx, bool enabled);
inline void setPendingInput(JSString *newInput);
RegExpFlag getFlags() const ;
bool createPendingInput(JSContext *cx, MutableHandleValue out);
bool createLastMatch(JSContext *cx, MutableHandleValue out);
bool createLastParen(JSContext *cx, MutableHandleValue out);
bool createParen(JSContext *cx, size_t pairNum, MutableHandleValue out);
bool createLeftContext(JSContext *cx, MutableHandleValue out);
bool createRightContext(JSContext *cx, MutableHandleValue out);
};
inline RegExpStatics * GlobalObject::getRegExpStatics() const {
JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
return static_cast<RegExpStatics *>(resObj.getPrivate());
}
inline void RegExpStatics::setPendingInput(JSString *newInput) {
}
inline void RegExpStatics::setMultiline(JSContext *cx, bool enabled) {
}
inline RegExpStatics * JSContext::regExpStatics() {
return 0;
}
size_t EscapeNakedForwardSlashes_oldLen = 0;
const jschar *EscapeNakedForwardSlashes_oldChars = 0;
static JSAtom * EscapeNakedForwardSlashes(JSContext *cx, HandleAtom unescaped) {
for (const jschar *it = EscapeNakedForwardSlashes_oldChars;
it < EscapeNakedForwardSlashes_oldChars + EscapeNakedForwardSlashes_oldLen;
++it)
return 0 ? 0 : 0;
}
RegExpFlag CompileRegExpObject_flags = RegExpFlag(0);
RegExpStatics *CompileRegExpObject_res = 0;
static bool CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args) {
RootedAtom source(cx);
RootedAtom escapedSourceStr(cx, EscapeNakedForwardSlashes(cx, source));
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(CompileRegExpObject_flags | CompileRegExpObject_res->getFlags()));
if (!reobj) return false;
}
__attribute__((always_inline)) inline bool IsRegExp(const Value &v) {
return 0 && 0;
}
__attribute__((always_inline)) inline bool regexp_compile_impl(JSContext *cx, CallArgs args) {
RegExpObjectBuilder builder(cx, &args.thisv().toObject().as<RegExpObject>());
return CompileRegExpObject(cx, builder, args);
}
static JSBool regexp_construct(JSContext *cx, unsigned argc, Value *vp) {
return true;
};
RegExpStatics *static_input_getter_res = 0;
static JSBool static_input_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_input_getter_res->createPendingInput(cx, vp);
}
static JSBool static_multiline_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return true;
}
RegExpStatics *static_lastMatch_getter_res = 0;
static JSBool static_lastMatch_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastMatch_getter_res->createLastMatch(cx, vp);
}
RegExpStatics *static_lastParen_getter_res = 0;
static JSBool static_lastParen_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastParen_getter_res->createLastParen(cx, vp);
}
RegExpStatics *static_leftContext_getter_res = 0;
static JSBool static_leftContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_leftContext_getter_res->createLeftContext(cx, vp);
}
RegExpStatics *static_rightContext_getter_res = 0;
static JSBool static_rightContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_rightContext_getter_res->createRightContext(cx, vp);
}
RegExpStatics *static_paren1_getter_res = 0;
static JSBool static_paren1_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren1_getter_res->createParen(cx, 1, vp);
}
RegExpStatics *static_paren2_getter_res = 0;
static JSBool static_paren2_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren2_getter_res->createParen(cx, 2, vp);
}
RegExpStatics *static_paren3_getter_res = 0;
static JSBool static_paren3_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren3_getter_res->createParen(cx, 3, vp);
}
RegExpStatics *static_paren4_getter_res = 0;
static JSBool static_paren4_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren4_getter_res->createParen(cx, 4, vp);
}
RegExpStatics *static_paren5_getter_res = 0;
static JSBool static_paren5_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren5_getter_res->createParen(cx, 5, vp);
}
RegExpStatics *static_paren6_getter_res = 0;
static JSBool static_paren6_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren6_getter_res->createParen(cx, 6, vp);
}
RegExpStatics *static_paren7_getter_res = 0;
static JSBool static_paren7_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren7_getter_res->createParen(cx, 7, vp);
}
RegExpStatics *static_paren8_getter_res = 0;
static JSBool static_paren8_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren8_getter_res->createParen(cx, 8, vp);
}
RegExpStatics *static_paren9_getter_res = 0;
static JSBool static_paren9_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren9_getter_res->createParen(cx, 9, vp);
}
RegExpStatics *static_input_setter_res = 0;
static JSBool static_input_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_input_setter_res->setPendingInput(0);
}
RegExpStatics *static_multiline_setter_res = 0;
static JSBool static_multiline_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_multiline_setter_res->setMultiline(cx, !!0);
}
const uint8_t REGEXP_STATIC_PROP_ATTRS = 0x04 | 0x40 | 0x01;
const uint8_t RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | 0x02;
static const JSPropertySpec regexp_static_props[] = {
"input", 0, REGEXP_STATIC_PROP_ATTRS,
static_input_getter, __null
,
static_input_setter, __null
,
"multiline", 0, REGEXP_STATIC_PROP_ATTRS,
static_multiline_getter, __null
,
static_multiline_setter, __null
, {
"lastMatch", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastMatch_getter, __null
}
, {
"lastParen", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastParen_getter, __null
}
, {
"leftContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_leftContext_getter, __null
}
, {
"rightContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_rightContext_getter, __null
}
, {
"$1", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren1_getter, __null
}
, {
"$2", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren2_getter, __null
}
, {
"$3", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren3_getter, __null
}
, {
"$4", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren4_getter, __null
}
, {
"$5", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren5_getter, __null
}
, {
"$6", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren6_getter, __null
}
, {
"$7", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren7_getter, __null
}
, {
"$8", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren8_getter, __null
}
,
"$9", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren9_getter, __null
};
JSObject * js_InitRegExpClass(JSContext *cx, HandleObject obj) {
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
RootedFunction ctor(cx);
ctor = global->createConstructor(cx, regexp_construct, 0, 2);
return 0;
}
static RegExpRunStatus ExecuteRegExp(JSContext *cx, CallArgs args, MatchConduit &matches) {
RootedObject regexp(cx, &args.thisv().toObject());
RootedString string(cx, 0);
return Trans_NS_js_ExecuteRegExp(cx, regexp, string, matches);
}
static bool regexp_test_impl(JSContext *cx, CallArgs args) {
MatchPair match;
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, args, conduit);
return status != RegExpRunStatus_Error;
}
JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
}
// this should reproduce the crash:
// /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=param-to-global --counter=6 /var/tmp/moz-build-dir/js/src/clang_delta_crash_tmp_filey2ULdf.ii
-------------- next part --------------
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
extern "C"
extern "C"
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
template<typename T, T Value> struct IntegralConstant {
static const T value = Value;
};
template<typename From, typename To> struct ConvertibleTester {
private: static From create();
template<typename From1, typename To1> static char test(void);
public: static const bool value = sizeof(test<From, To>()) == sizeof(char);
};
template<typename From, typename To> struct IsConvertible : IntegralConstant<bool, ConvertibleTester<From, To>::value> {
};
template<bool B, typename T = void> struct EnableIf;
template<typename T> struct EnableIf<true, T> {
typedef T Type;
};
template<bool Condition, typename A, typename B> struct Conditional {
typedef A Type;
};
template<typename To, typename From> inline To BitwiseCast(void) ;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long int uintptr_t;
typedef int JSBool;
struct JSContext;
namespace JS {
class Value;
template <typename T> class Rooted;
struct Zone;
}
typedef ptrdiff_t jsid;
typedef uint16_t jschar;
typedef enum JSType {
}
JSType;
typedef enum JSProtoKey {
JSProto_LIMIT }
JSGCTraceKind;
typedef struct JSCompartment JSCompartment;
typedef struct JSRuntime JSRuntime;
class JSFunction;
class JSObject;
class JSScript;
class JSString;
namespace JS {
struct Runtime {
};
}
struct ContextFriendFields {
protected: JSRuntime *const runtime_;
JSCompartment *compartment_;
JS::Zone *zone_;
public: JSRuntime * ContextFriendFields_rt;
explicit ContextFriendFields(void) : runtime_(ContextFriendFields_rt), compartment_(__null), zone_(__null) {
}
};
struct PerThreadDataFriendFields {
};
template <typename T> struct GCMethods ;
template <typename T> class RootedBase {
};
template <typename T> class HandleBase {
};
template <typename T> class MutableHandleBase {
};
namespace JS {
template <typename T> class Handle : public HandleBase<T> {
public: template <typename S> Handle( void) ;
static Handle fromMarkedLocation(void) ;
template <typename S> inline Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy = 0);
const T *address() const ;
const T& get() const ;
operator const T&() const ;
T operator->() const ;
private: Handle() ;
const T *ptr;
};
typedef Handle<JSObject*> HandleObject;
typedef Handle<JSScript*> HandleScript;
typedef Handle<JSString*> HandleString;
typedef Handle<jsid> HandleId;
typedef Handle<Value> HandleValue;
template <typename T> class MutableHandle : public MutableHandleBase<T> {
public: ;
T *address() const ;
T get() const ;
operator T() const ;
T *ptr;
};
typedef MutableHandle<Value> MutableHandleValue;
}
template <typename T> struct GCMethods ;
namespace JS {
template <typename T> class Rooted : public RootedBase<T> {
public: Rooted(JSContext *cx ) : ptr(0) {
}
Rooted(JSContext *cx, T initial ) : ptr(initial) {
}
operator const T&() const ;
T operator->() const ;
T &operator=(T value) ;
T ptr;
};
typedef Rooted<JSObject*> RootedObject;
typedef Rooted<JSFunction*> RootedFunction;
typedef Rooted<JSString*> RootedString;
}
enum AllowGC {
};
template <typename T, AllowGC allowGC> class MaybeRooted ;
namespace JS {
template <typename T> template <typename S> inline Handle<T>::Handle(const Rooted<S> &root, typename EnableIf<IsConvertible<S, T>::value, int>::Type dummy) {
}
}
enum JSValueType {
JSVAL_TYPE_BOOLEAN , JSVAL_TYPE_STRING , JSVAL_TYPE_NULL , JSVAL_TYPE_OBJECT }
__attribute__((packed));
enum JSValueTag {
JSVAL_TAG_MAX_DOUBLE , JSVAL_TAG_STRING , JSVAL_TAG_BOOLEAN , JSVAL_TAG_NULL , JSVAL_TAG_OBJECT }
__attribute__((packed));
enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_NULL }
JSWhyMagic;
typedef union jsval_layout {
uint64_t asBits;
}
__attribute__((aligned )) jsval_layout;
jsval_layout JSVAL_IS_STRING_IMPL_l;
static inline JSBool JSVAL_IS_STRING_IMPL(void) {
return JSVAL_IS_STRING_IMPL_l.asBits >> 47 == JSVAL_TAG_STRING;
}
jsval_layout JSVAL_TO_STRING_IMPL_l;
static inline JSString * JSVAL_TO_STRING_IMPL(void) {
return (JSString *)(JSVAL_TO_STRING_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL);
}
jsval_layout JSVAL_IS_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_IS_BOOLEAN_IMPL(void) {
return JSVAL_IS_BOOLEAN_IMPL_l.asBits >> 47 == JSVAL_TAG_BOOLEAN;
}
jsval_layout JSVAL_TO_BOOLEAN_IMPL_l;
static inline JSBool JSVAL_TO_BOOLEAN_IMPL(void) {
return JSVAL_TO_BOOLEAN_IMPL_l.asBits;
}
jsval_layout JSVAL_IS_OBJECT_IMPL_l;
static inline JSBool JSVAL_IS_OBJECT_IMPL(void) {
return JSVAL_IS_OBJECT_IMPL_l.asBits >= JSVAL_SHIFTED_TAG_NULL;
}
jsval_layout JSVAL_TO_OBJECT_IMPL_l;
static inline JSObject * JSVAL_TO_OBJECT_IMPL(void) {
uint64_t ptrBits = JSVAL_TO_OBJECT_IMPL_l.asBits & 0x00007FFFFFFFFFFFLL;
return (JSObject *)ptrBits;
}
static inline jsval_layout JSVAL_TO_IMPL(void);
namespace JS {
class Value {
public:
bool isObject() const ;
JSObject &toObject() const ;
private: jsval_layout data;
friend jsval_layout (::JSVAL_TO_IMPL)(void);
};
}
template <class Outer> class ValueOperations {
const JS::Value * value() const ;
public:
JSObject &toObject() const ;
};
template <> class HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> > {
friend class ValueOperations;
const JS::Value * extract() const ;
};
JS::Value JSVAL_TO_IMPL_v;
inline jsval_layout JSVAL_TO_IMPL(void) {
return JSVAL_TO_IMPL_v.data;
}
typedef JS::Value jsval;
jsval JSVAL_IS_STRING_v;
static inline JSBool JSVAL_IS_STRING(void) {
return 0;
}
static inline JSString * JSVAL_TO_STRING(jsval v) {
return 0;
}
static inline JSBool JSVAL_IS_BOOLEAN(jsval v) {
return 0;
}
static inline JSBool JSVAL_TO_BOOLEAN(jsval v) {
return 0;
}
typedef JSBool (* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);
namespace JS {
enum UsedRval {
IncludeUsedRval, NoUsedRval };
template<UsedRval WantUsedRval> class UsedRvalBase;
template<> class UsedRvalBase<NoUsedRval> {
};
template<UsedRval WantUsedRval> class CallReceiverBase : public UsedRvalBase< NoUsedRval > {
protected: Value *argv_;
public:
HandleValue thisv() const ;
};
class CallReceiver : public CallReceiverBase<IncludeUsedRval> {
};
template<UsedRval WantUsedRval> class CallArgsBase : public Conditional<WantUsedRval == IncludeUsedRval, CallReceiver, CallReceiverBase<NoUsedRval> >::Type {
protected: unsigned argc_;
public: unsigned length() const ;
HandleValue handleOrUndefinedAt(unsigned i) const ;
};
class CallArgs : public CallArgsBase<IncludeUsedRval> {
private: friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);
static CallArgs create(unsigned argc, Value *argv) ;
};
__attribute__((always_inline)) inline CallArgs CallArgsFromVp(unsigned argc, Value *vp) {
return CallArgs::create(argc, vp + 2);
}
}
template <class T, size_t N, class AP, bool IsPod> struct VectorImpl ;
template <class T, size_t N, class AllocPolicy> class Vector : private AllocPolicy {
size_t mLength;
public: static const size_t sMaxInlineStorage = N;
Vector(AllocPolicy = AllocPolicy());
bool empty() const ;
};
namespace JS {
class __attribute__((visibility("default"))) AutoGCRooter ;
typedef bool (*IsAcceptableThis)(const Value &v);
typedef bool (*NativeImpl)(JSContext *cx, CallArgs args);
extern __attribute__((visibility("default"))) bool CallMethodIfWrapped;
template<IsAcceptableThis Test, NativeImpl Impl> __attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, CallArgs args) ;
__attribute__((always_inline)) inline bool CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args) {
const Value &thisv = args.thisv();
if (Test(thisv)) return 0;
return 0;
}
}
typedef JSBool (* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
typedef JSBool (* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);
extern __attribute__((visibility("default"))) JSBool JS_ConvertValue;
namespace JS {
}
typedef struct JSJitInfo JSJitInfo;
typedef struct JSStrictPropertyOpWrapper {
JSStrictPropertyOp op;
const JSJitInfo *info;
}
JSStrictPropertyOpWrapper;
typedef struct JSPropertyOpWrapper {
JSPropertyOp op;
const JSJitInfo *info;
}
JSPropertyOpWrapper;
struct JSPropertySpec {
const char *name;
int8_t tinyid;
uint8_t flags;
JSPropertyOpWrapper getter;
JSStrictPropertyOpWrapper setter;
};
using JS::Value;
using JS::CallArgs;
using JS::Rooted;
using JS::RootedObject;
using JS::RootedFunction;
using JS::RootedString;
using JS::Handle;
using JS::HandleObject;
using JS::HandleString;
using JS::HandleId;
using JS::MutableHandleValue;
typedef uint8_t jsbytecode;
class JSAtom;
class RegExpObject;
class RegExpStatics;
enum RegExpFlag {
};
class FrameRegs;
class GlobalObject;
class Shape;
struct TypeObject;
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Rooted<JSAtom*> RootedAtom;
struct MatchPair {
};
struct MatchConduit {
explicit MatchConduit(MatchPair *pair) ;
};
template<typename T> class LinkedListElement {
};
class SpecialId ;
struct Class ;
struct BaseShape ;
class Trans_NS_shadow_Shape ;
struct Object ;
namespace JS {
struct ArenaHeader {
};
}
struct ArenaHeader;
struct Chunk;
enum AllocKind {
FINALIZE_OBJECT4_BACKGROUND, FINALIZE_IONCODE, FINALIZE_LAST };
struct Cell {
public: inline ArenaHeader *arenaHeader() const;
__attribute__((always_inline)) inline void unmark(uint32_t color) const;
protected: inline uintptr_t address() const;
inline Chunk *chunk() const;
uintptr_t first;
uintptr_t last;
static size_t encodeOffsets ;
uintptr_t arenaAddress() const ;
};
struct ArenaHeader : public JS::ArenaHeader {
size_t allocKind : 8;
;
private: static __attribute__((visibility("default"))) const uint32_t ThingSizes[];
};
static void AssertValidColor(const void *thing, uint32_t color) {
}
void Cell::unmark(uint32_t color) const {
AssertValidColor(this, color);
}
template<class T, typename Unioned = uintptr_t> class EncapsulatedPtr {
protected: union {
T *value;
};
public:
T *operator->() const ;
operator T*() const ;
};
template <class T, class Unioned = uintptr_t> class HeapPtr : public EncapsulatedPtr<T, Unioned> {
};
template <class T> class FixedHeapPtr {
T *value;
public: operator T*() const ;
};
typedef HeapPtr<JSObject> HeapPtrObject;
typedef HeapPtr<TypeObject> HeapPtrTypeObject;
class EncapsulatedValue : public ValueOperations<EncapsulatedValue> {
protected: Value value;
public:
operator const Value &() const ;
};
class HeapSlot : public EncapsulatedValue {
};
template<class T> class ReadBarriered ;;
struct TypeObjectKey ;
class Type ;
struct TypeNewScript ;
struct TypeObject : Cell {
Class *clasp;
HeapPtrObject proto;
};
template <AllowGC allowGC> extern JSString * ToStringSlow(JSContext *cx, typename MaybeRooted<Value, allowGC>::HandleType arg);
template <AllowGC allowGC> static __attribute__((always_inline)) inline JSString * ToString(JSContext *cx, JS::HandleValue v) ;
class JSString : public Cell {
protected: static const size_t NUM_INLINE_CHARS = 2 * sizeof(void *) / sizeof(jschar);
struct Data {
size_t lengthAndFlags;
union {
const jschar *chars;
}
u1;
}
d;
public: static const size_t LENGTH_SHIFT = 4;
public: __attribute__((always_inline)) inline size_t length() const ;
};
class JSLinearString : public JSString {
public: __attribute__((always_inline)) inline const jschar *chars() const ;
};
class JSFlatString : public JSLinearString {
};
class JSAtom : public JSFlatString {
};
class PropertyName : public JSAtom {
};
class ObjectImpl : public Cell {
HeapPtrTypeObject type_;
public:
Class *getClass() const ;
HeapSlot *fixedSlots() const ;
uint32_t numFixedSlots() const ;
const Value &getSlot(uint32_t slot) const ;
inline void *&privateRef(uint32_t nfixed) const ;
inline void *getPrivate() const {
return 0;
}
};
class JSObject : public ObjectImpl {
public: ;
template <class T> inline bool is() const ;
template <class T> T &as() ;
};
class JSFunction : public JSObject {
public: static Class class_;
union U {
struct Scripted {
union
s;
}
i;
}
u;
JSScript *nonLazyScript() const ;
static const AllocKind FinalizeKind = FINALIZE_OBJECT4_BACKGROUND;
};
class StackFrame ;
class InterpreterActivation;
class Activation {
protected: JSContext *cx_;
public:
InterpreterActivation *asInterpreter() const ;
};
class InterpreterActivation : public Activation {
StackFrame *current_;
public: ;
};
struct JSAtomState {
FixedHeapPtr<PropertyName> RegExp;
};
class PerThreadData : public PerThreadDataFriendFields {
public: uint8_t *ionTop;
Activation *activation_;
};
template<class Client> struct MallocProvider {
};
struct JSRuntime : public JS::Runtime, public MallocProvider<JSRuntime> {
PerThreadData mainThread;
union {
JSAtomState atomState;
};
};
struct ThreadSafeContext : ContextFriendFields, public MallocProvider<ThreadSafeContext> {
};
struct JSContext : ThreadSafeContext, public LinkedListElement<JSContext> {
JSRuntime *runtime() const ;
JSCompartment *compartment() const ;
inline Handle<GlobalObject*> global() const;
inline RegExpStatics *regExpStatics();
enum MaybeAllowCrossCompartment {
};
;
JSAtomState & names() ;
};
class ContextAllocPolicy ;;
enum RegExpRunStatus {
RegExpRunStatus_Error, RegExpRunStatus_Success_NotFound };
class RegExpObjectBuilder {
public: RegExpObjectBuilder(JSContext *cx, RegExpObject *reobj = __null);
RegExpObject *build(HandleAtom source, RegExpFlag flags);
};
class RegExpObject : public JSObject {
public: static const unsigned RESERVED_SLOTS = 6;
static Class class_;
};
RegExpRunStatus Trans_NS_js_ExecuteRegExp(JSContext *cx, HandleObject regexp, HandleString string, MatchConduit &matches);
extern JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp);
class StringBuffer ;
class GlobalObject : public JSObject {
static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 3;
static const unsigned EVAL = STANDARD_CLASS_SLOTS;
static const unsigned CREATE_DATAVIEW_FOR_THIS = EVAL + 1;
static const unsigned THROWTYPEERROR = CREATE_DATAVIEW_FOR_THIS + 1;
static const unsigned PROTO_GETTER = THROWTYPEERROR + 1;
static const unsigned FROM_BUFFER_UINT8 = PROTO_GETTER + 1;
static const unsigned FROM_BUFFER_INT8 = FROM_BUFFER_UINT8 + 1;
static const unsigned FROM_BUFFER_UINT16 = FROM_BUFFER_INT8 + 1;
static const unsigned FROM_BUFFER_INT16 = FROM_BUFFER_UINT16 + 1;
static const unsigned FROM_BUFFER_UINT32 = FROM_BUFFER_INT16 + 1;
static const unsigned FROM_BUFFER_INT32 = FROM_BUFFER_UINT32 + 1;
static const unsigned FROM_BUFFER_FLOAT32 = FROM_BUFFER_INT32 + 1;
static const unsigned FROM_BUFFER_FLOAT64 = FROM_BUFFER_FLOAT32 + 1;
static const unsigned FROM_BUFFER_UINT8CLAMPED = FROM_BUFFER_FLOAT64 + 1;
static const unsigned ELEMENT_ITERATOR_PROTO = FROM_BUFFER_UINT8CLAMPED + 1;
static const unsigned GENERATOR_PROTO = ELEMENT_ITERATOR_PROTO + 1;
static const unsigned MAP_ITERATOR_PROTO = GENERATOR_PROTO + 1;
static const unsigned SET_ITERATOR_PROTO = MAP_ITERATOR_PROTO + 1;
static const unsigned COLLATOR_PROTO = SET_ITERATOR_PROTO + 1;
static const unsigned NUMBER_FORMAT_PROTO = COLLATOR_PROTO + 1;
static const unsigned DATE_TIME_FORMAT_PROTO = NUMBER_FORMAT_PROTO + 1;
static const unsigned REGEXP_STATICS = DATE_TIME_FORMAT_PROTO + 1;
public: ;
JSFunction * createConstructor(JSContext *cx, JSNative ctor, JSAtom *name, unsigned length, AllocKind kind = JSFunction::FinalizeKind);
JSObject *createBlankPrototype;
inline RegExpStatics *getRegExpStatics() const;
};
struct JSCompartment ;
inline Handle<GlobalObject*> JSContext::global() const {
return Handle<GlobalObject*>::fromMarkedLocation();
}
class RegExpStatics {
RegExpFlag flags;
RegExpStatics *bufferLink;
bool copied;
public:
inline void setMultiline(JSContext *cx, bool enabled);
inline void setPendingInput(JSString *newInput);
RegExpFlag getFlags() const ;
bool createPendingInput(JSContext *cx, MutableHandleValue out);
bool createLastMatch(JSContext *cx, MutableHandleValue out);
bool createLastParen(JSContext *cx, MutableHandleValue out);
bool createParen(JSContext *cx, size_t pairNum, MutableHandleValue out);
bool createLeftContext(JSContext *cx, MutableHandleValue out);
bool createRightContext(JSContext *cx, MutableHandleValue out);
};
inline RegExpStatics * GlobalObject::getRegExpStatics() const {
JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
return static_cast<RegExpStatics *>(resObj.getPrivate());
}
inline void RegExpStatics::setPendingInput(JSString *newInput) {
}
inline void RegExpStatics::setMultiline(JSContext *cx, bool enabled) {
}
inline RegExpStatics * JSContext::regExpStatics() {
return 0;
}
size_t EscapeNakedForwardSlashes_oldLen = 0;
const jschar *EscapeNakedForwardSlashes_oldChars = 0;
static JSAtom * EscapeNakedForwardSlashes(JSContext *cx, HandleAtom unescaped) {
for (const jschar *it = EscapeNakedForwardSlashes_oldChars;
it < EscapeNakedForwardSlashes_oldChars + EscapeNakedForwardSlashes_oldLen;
++it)
return 0 ? 0 : 0;
}
RegExpFlag CompileRegExpObject_flags = RegExpFlag(0);
RegExpStatics *CompileRegExpObject_res = 0;
static bool CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args) {
RootedAtom source(cx);
RootedAtom escapedSourceStr(cx, EscapeNakedForwardSlashes(cx, source));
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(CompileRegExpObject_flags | CompileRegExpObject_res->getFlags()));
if (!reobj) return false;
}
__attribute__((always_inline)) inline bool IsRegExp(const Value &v) {
return 0 && 0;
}
__attribute__((always_inline)) inline bool regexp_compile_impl(JSContext *cx, CallArgs args) {
RegExpObjectBuilder builder(cx, &args.thisv().toObject().as<RegExpObject>());
return CompileRegExpObject(cx, builder, args);
}
static JSBool regexp_construct(JSContext *cx, unsigned argc, Value *vp) {
return true;
};
RegExpStatics *static_input_getter_res = 0;
static JSBool static_input_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_input_getter_res->createPendingInput(cx, vp);
}
static JSBool static_multiline_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return true;
}
RegExpStatics *static_lastMatch_getter_res = 0;
static JSBool static_lastMatch_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastMatch_getter_res->createLastMatch(cx, vp);
}
RegExpStatics *static_lastParen_getter_res = 0;
static JSBool static_lastParen_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_lastParen_getter_res->createLastParen(cx, vp);
}
RegExpStatics *static_leftContext_getter_res = 0;
static JSBool static_leftContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_leftContext_getter_res->createLeftContext(cx, vp);
}
RegExpStatics *static_rightContext_getter_res = 0;
static JSBool static_rightContext_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_rightContext_getter_res->createRightContext(cx, vp);
}
RegExpStatics *static_paren1_getter_res = 0;
static JSBool static_paren1_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren1_getter_res->createParen(cx, 1, vp);
}
RegExpStatics *static_paren2_getter_res = 0;
static JSBool static_paren2_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren2_getter_res->createParen(cx, 2, vp);
}
RegExpStatics *static_paren3_getter_res = 0;
static JSBool static_paren3_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren3_getter_res->createParen(cx, 3, vp);
}
RegExpStatics *static_paren4_getter_res = 0;
static JSBool static_paren4_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren4_getter_res->createParen(cx, 4, vp);
}
RegExpStatics *static_paren5_getter_res = 0;
static JSBool static_paren5_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren5_getter_res->createParen(cx, 5, vp);
}
RegExpStatics *static_paren6_getter_res = 0;
static JSBool static_paren6_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren6_getter_res->createParen(cx, 6, vp);
}
RegExpStatics *static_paren7_getter_res = 0;
static JSBool static_paren7_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren7_getter_res->createParen(cx, 7, vp);
}
RegExpStatics *static_paren8_getter_res = 0;
static JSBool static_paren8_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren8_getter_res->createParen(cx, 8, vp);
}
RegExpStatics *static_paren9_getter_res = 0;
static JSBool static_paren9_getter(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) {
return static_paren9_getter_res->createParen(cx, 9, vp);
}
RegExpStatics *static_input_setter_res = 0;
static JSBool static_input_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_input_setter_res->setPendingInput(0);
}
RegExpStatics *static_multiline_setter_res = 0;
static JSBool static_multiline_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp) {
if (!0 && !0) return false;
static_multiline_setter_res->setMultiline(cx, !!0);
}
const uint8_t REGEXP_STATIC_PROP_ATTRS = 0x04 | 0x40 | 0x01;
const uint8_t RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | 0x02;
static const JSPropertySpec regexp_static_props[] = {
"input", 0, REGEXP_STATIC_PROP_ATTRS,
static_input_getter, __null
,
static_input_setter, __null
,
"multiline", 0, REGEXP_STATIC_PROP_ATTRS,
static_multiline_getter, __null
,
static_multiline_setter, __null
, {
"lastMatch", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastMatch_getter, __null
}
, {
"lastParen", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_lastParen_getter, __null
}
, {
"leftContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_leftContext_getter, __null
}
, {
"rightContext", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_rightContext_getter, __null
}
, {
"$1", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren1_getter, __null
}
, {
"$2", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren2_getter, __null
}
, {
"$3", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren3_getter, __null
}
, {
"$4", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren4_getter, __null
}
, {
"$5", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren5_getter, __null
}
, {
"$6", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren6_getter, __null
}
, {
"$7", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren7_getter, __null
}
, {
"$8", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren8_getter, __null
}
,
"$9", 0, RO_REGEXP_STATIC_PROP_ATTRS,
static_paren9_getter, __null
};
JSObject * js_InitRegExpClass(JSContext *cx, HandleObject obj) {
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
RootedFunction ctor(cx);
ctor = global->createConstructor(cx, regexp_construct, 0, 2);
return 0;
}
static RegExpRunStatus ExecuteRegExp(JSContext *cx, CallArgs args, MatchConduit &matches) {
RootedObject regexp(cx, &args.thisv().toObject());
RootedString string(cx, 0);
return Trans_NS_js_ExecuteRegExp(cx, regexp, string, matches);
}
static bool regexp_test_impl(JSContext *cx, CallArgs args) {
MatchPair match;
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, args, conduit);
return status != RegExpRunStatus_Error;
}
JSBool regexp_test(JSContext *cx, unsigned argc, Value *vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
}
// this should reproduce the crash:
// /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=param-to-global --counter=9 /var/tmp/moz-build-dir/js/src/clang_delta_crash_tmp_filezwW9yH.ii
-------------- next part --------------
typedef long unsigned int size_t;
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef int int64_t __attribute__ ((__mode__ (__DI__)));
extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef int pixman_bool_t;
typedef int64_t pixman_fixed_32_32_t;
typedef pixman_fixed_32_32_t pixman_fixed_48_16_t;
typedef int32_t pixman_fixed_16_16_t;
typedef pixman_fixed_16_16_t pixman_fixed_t;
typedef struct pixman_vector pixman_vector_t;
typedef struct pixman_transform pixman_transform_t;
struct pixman_vector {
pixman_fixed_t vector[3];
};
struct pixman_transform {
pixman_fixed_t matrix[3][3];
};
typedef struct pixman_image pixman_image_t;
pixman_bool_t _moz_pixman_transform_point_3d ( void);
typedef enum {
PIXMAN_REPEAT_NONE, PIXMAN_REPEAT_REFLECT }
pixman_repeat_t;
typedef enum {
PIXMAN_FILTER_FAST, PIXMAN_FILTER_NEAREST, PIXMAN_FILTER_SEPARABLE_CONVOLUTION }
pixman_filter_t;
typedef enum {
PIXMAN_a8r8g8b8 , PIXMAN_x8r8g8b8 , PIXMAN_r5g6b5 , PIXMAN_a8 }
pixman_format_code_t;
typedef struct image_common image_common_t;
typedef struct bits_image bits_image_t;
typedef struct argb_t argb_t;
struct argb_t {
};
typedef void (*fetch_scanline_t) (pixman_image_t *image, int x, int y, int width, uint32_t *buffer, const uint32_t *mask);
typedef uint32_t *fetch_pixel_32_t ;
typedef void (*store_scanline_t) (bits_image_t * image, int x, int y, int width, const uint32_t *values);
typedef void *property_changed_func_t ;
struct image_common {
pixman_transform_t * transform;
pixman_repeat_t repeat;
pixman_filter_t filter;
pixman_fixed_t filter_params;
property_changed_func_t property_changed;
uint32_t flags;
pixman_format_code_t extended_format_code;
};
struct bits_image {
image_common_t common;
int width;
int height;
uint32_t bits;
uint32_t * free_me;
int rowstride;
fetch_scanline_t fetch_scanline_16;
fetch_scanline_t fetch_scanline_32;
fetch_pixel_32_t fetch_pixel_32;
store_scanline_t store_scanline_32;
fetch_scanline_t fetch_scanline_float;
store_scanline_t store_scanline_16;
};
struct pixman_image {
image_common_t common;
bits_image_t bits;
};
typedef struct pixman_iter_t pixman_iter_t;
typedef uint32_t *(* pixman_iter_get_scanline_t) (pixman_iter_t *iter, const uint32_t *mask);
typedef void * pixman_iter_write_back_t ;
typedef enum {
ITER_IGNORE_ALPHA , ITER_IGNORE_RGB , ITER_16 }
iter_flags_t;
struct pixman_iter_t {
pixman_image_t * image;
uint32_t buffer;
int x, y;
int width;
iter_flags_t iter_flags;
pixman_iter_get_scanline_t get_scanline;
pixman_iter_write_back_t write_back;
void * data;
};
void pixman_expand_to_float ( const uint32_t *src);
pixman_repeat_t repeat_repeat;
static __inline__ __attribute__ ((__always_inline__)) pixman_bool_t repeat ( int *c, int size) {
return 1;
}
pixman_fixed_t pixman_fixed_to_bilinear_weight_x;
static __inline__ __attribute__ ((__always_inline__)) int pixman_fixed_to_bilinear_weight (void) {
return pixman_fixed_to_bilinear_weight_x >> (16 - 7) & - 1;
}
uint32_t bilinear_interpolation_tl;
uint32_t bilinear_interpolation_tr;
uint32_t bilinear_interpolation_bl;
uint32_t bilinear_interpolation_br;
int bilinear_interpolation_distx;
int bilinear_interpolation_disty;
static __inline__ __attribute__ ((__always_inline__)) uint32_t bilinear_interpolation ( void) {
int distxy, distxiy, distixy, distixiy;
uint32_t f, r;
distxy = bilinear_interpolation_distx * bilinear_interpolation_disty;
distxiy = - distxy;
distixy = - distxy;
distixiy = 256 * 256 - - + distxy;
r = (bilinear_interpolation_tl & 0x000000ff) * distixiy + (bilinear_interpolation_tr & 0x000000ff) * distxiy + (bilinear_interpolation_bl & 0x000000ff) * distixy + (bilinear_interpolation_br & 0x000000ff) * distxy;
f = (bilinear_interpolation_tl & 0x0000ff00) * distixiy + (bilinear_interpolation_tr & 0x0000ff00) * distxiy + (bilinear_interpolation_bl & 0x0000ff00) * distixy + (bilinear_interpolation_br & 0x0000ff00) * distxy;
r |= f & 0xff000000;
return r;
}
static uint32_t * _pixman_image_get_scanline_generic_float (pixman_iter_t * iter, const uint32_t *mask) {
pixman_iter_get_scanline_t fetch_32 = iter->data;
uint32_t buffer = iter->buffer;
fetch_32 (iter, 0);
pixman_expand_to_float ( &buffer);
return &iter->buffer;
}
typedef uint32_t (* get_pixel_t) (bits_image_t *image, int x, int y, pixman_bool_t check_bounds);
int bits_image_fetch_pixel_nearest_x1;
int bits_image_fetch_pixel_nearest_y1;
int bits_image_fetch_pixel_nearest_x2;
int bits_image_fetch_pixel_nearest_y2;
uint32_t bits_image_fetch_pixel_nearest_tl;
uint32_t bits_image_fetch_pixel_nearest_tr;
uint32_t bits_image_fetch_pixel_nearest_bl;
uint32_t bits_image_fetch_pixel_nearest_br;
int32_t bits_image_fetch_pixel_nearest_distx;
int32_t bits_image_fetch_pixel_nearest_disty;
bits_image_t * bits_image_fetch_pixel_nearest_image;
pixman_fixed_t bits_image_fetch_pixel_nearest_x;
pixman_fixed_t bits_image_fetch_pixel_nearest_y;
static __inline__ __attribute__ ((__always_inline__)) uint32_t bits_image_fetch_pixel_nearest ( get_pixel_t get_pixel) {
int x0 = (bits_image_fetch_pixel_nearest_x - 1) >> 16;
int y0 = (bits_image_fetch_pixel_nearest_y - 1) >> 16;
if (bits_image_fetch_pixel_nearest_image->common.repeat != PIXMAN_REPEAT_NONE)
return 0;
else
return get_pixel (bits_image_fetch_pixel_nearest_image, x0, y0, 1);
pixman_repeat_t repeat_mode = bits_image_fetch_pixel_nearest_image->common.repeat;
int width = bits_image_fetch_pixel_nearest_image->width;
int height = bits_image_fetch_pixel_nearest_image->height;
if (repeat_mode != PIXMAN_REPEAT_NONE)
repeat ( &bits_image_fetch_pixel_nearest_x1, width);
repeat ( &bits_image_fetch_pixel_nearest_y1, height);
bits_image_fetch_pixel_nearest_br = get_pixel (bits_image_fetch_pixel_nearest_image, bits_image_fetch_pixel_nearest_x2, bits_image_fetch_pixel_nearest_y2, 1);
return bilinear_interpolation ( );
}
pixman_fixed_t bits_image_fetch_bilinear_no_repeat_8888_x_top;
pixman_fixed_t bits_image_fetch_bilinear_no_repeat_8888_x_bottom;
pixman_fixed_t bits_image_fetch_bilinear_no_repeat_8888_ux_top;
pixman_fixed_t bits_image_fetch_bilinear_no_repeat_8888_ux_bottom;
pixman_fixed_t bits_image_fetch_bilinear_no_repeat_8888_ux;
pixman_vector_t bits_image_fetch_bilinear_no_repeat_8888_v;
pixman_fixed_t bits_image_fetch_bilinear_no_repeat_8888_v_0_0;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_bottom_mask;
uint32_t *bits_image_fetch_bilinear_no_repeat_8888_top_row;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_top_row_0;
uint32_t *bits_image_fetch_bilinear_no_repeat_8888_bottom_row;
uint32_t *bits_image_fetch_bilinear_no_repeat_8888_end;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_zero[2];
uint32_t bits_image_fetch_bilinear_no_repeat_8888_one = 1;
int bits_image_fetch_bilinear_no_repeat_8888_y;
int bits_image_fetch_bilinear_no_repeat_8888_y1;
int bits_image_fetch_bilinear_no_repeat_8888_y2;
int bits_image_fetch_bilinear_no_repeat_8888_disty;
int bits_image_fetch_bilinear_no_repeat_8888_mask_inc;
int bits_image_fetch_bilinear_no_repeat_8888_w;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_tl;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_tr;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_bl;
uint32_t bits_image_fetch_bilinear_no_repeat_8888_br;
int32_t bits_image_fetch_bilinear_no_repeat_8888_distx;
static uint32_t * bits_image_fetch_bilinear_no_repeat_8888 (pixman_iter_t *iter, const uint32_t *mask) {
pixman_image_t ima = *(iter->image);
int offset = iter->x;
int line = iter->y++;
int width = iter->width;
uint32_t * buffer = &iter->buffer;
bits_image_t bits = ima.bits;
pixman_fixed_t x;
uint32_t top_mask;
bits_image_fetch_bilinear_no_repeat_8888_v_0_0 = (offset << 16) + (1 << 16) / 2;
bits_image_fetch_bilinear_no_repeat_8888_v.vector[1] = (line << 16) + (1 << 16) / 2;
bits_image_fetch_bilinear_no_repeat_8888_ux = bits_image_fetch_bilinear_no_repeat_8888_ux_top = bits_image_fetch_bilinear_no_repeat_8888_ux_bottom = bits.common.transform->matrix[0][0];
x = bits_image_fetch_bilinear_no_repeat_8888_x_top = bits_image_fetch_bilinear_no_repeat_8888_x_bottom = bits_image_fetch_bilinear_no_repeat_8888_v_0_0 - (1 << 16)/2;
bits_image_fetch_bilinear_no_repeat_8888_y = bits_image_fetch_bilinear_no_repeat_8888_v.vector[1] - (1 < 16)/2;
bits_image_fetch_bilinear_no_repeat_8888_disty = 0;
bits_image_fetch_bilinear_no_repeat_8888_y1 = bits_image_fetch_bilinear_no_repeat_8888_y > 16;
bits_image_fetch_bilinear_no_repeat_8888_y2 = bits_image_fetch_bilinear_no_repeat_8888_y1 + 1;
if (bits_image_fetch_bilinear_no_repeat_8888_y1 < 0 || bits_image_fetch_bilinear_no_repeat_8888_y1 >= bits.height)
bits_image_fetch_bilinear_no_repeat_8888_top_row = bits_image_fetch_bilinear_no_repeat_8888_zero;
if (bits_image_fetch_bilinear_no_repeat_8888_y2 < 0 || bits_image_fetch_bilinear_no_repeat_8888_y2 >= bits.height)
bits_image_fetch_bilinear_no_repeat_8888_mask_inc = 0;
mask = &bits_image_fetch_bilinear_no_repeat_8888_one;
top_mask = 0;
bits_image_fetch_bilinear_no_repeat_8888_end = buffer + width;
bits_image_fetch_bilinear_no_repeat_8888_w = (bits.width - 1) < 16;
while (buffer < bits_image_fetch_bilinear_no_repeat_8888_end && x < bits_image_fetch_bilinear_no_repeat_8888_w)
if (*mask) {
bits_image_fetch_bilinear_no_repeat_8888_tl = bits_image_fetch_bilinear_no_repeat_8888_top_row_0 | top_mask;
bits_image_fetch_bilinear_no_repeat_8888_tr = bits_image_fetch_bilinear_no_repeat_8888_top_row [ + 1] | top_mask;
bits_image_fetch_bilinear_no_repeat_8888_bl = bits_image_fetch_bilinear_no_repeat_8888_bottom_row [ bits_image_fetch_bilinear_no_repeat_8888_x_bottom > 16] | bits_image_fetch_bilinear_no_repeat_8888_bottom_mask;
bits_image_fetch_bilinear_no_repeat_8888_distx = 0;
*buffer = bilinear_interpolation ( );
}
x += bits_image_fetch_bilinear_no_repeat_8888_ux;
mask += bits_image_fetch_bilinear_no_repeat_8888_mask_inc;
return &iter->buffer;
}
int bits_image_fetch_pixel_separable_convolution_x_off = - 1 << 16 >> 1;
int bits_image_fetch_pixel_separable_convolution_y_off = - 1 << 16 >> 1;
int bits_image_fetch_pixel_separable_convolution_srtot;
int bits_image_fetch_pixel_separable_convolution_sgtot;
int bits_image_fetch_pixel_separable_convolution_sbtot;
int bits_image_fetch_pixel_separable_convolution_satot;
int32_t bits_image_fetch_pixel_separable_convolution_x2;
pixman_fixed_t bits_image_fetch_pixel_separable_convolution_f;
bits_image_t bits_image_fetch_pixel_separable_convolution_image;
pixman_fixed_t bits_image_fetch_pixel_separable_convolution_x;
pixman_fixed_t bits_image_fetch_pixel_separable_convolution_y;
get_pixel_t bits_image_fetch_pixel_separable_convolution_get_pixel;
static uint32_t bits_image_fetch_pixel_separable_convolution ( void) {
pixman_fixed_t *params = &bits_image_fetch_pixel_separable_convolution_image.common.filter_params;
pixman_repeat_t repeat_mode = bits_image_fetch_pixel_separable_convolution_image.common.repeat;
int width = bits_image_fetch_pixel_separable_convolution_image.width;
int height = bits_image_fetch_pixel_separable_convolution_image.height;
int cwidth = params[0] >> 16;
int cheight = params[1] >> 16;
int x_phase_bits = params[2] >> 16;
int y_phase_bits = params[3] >> 16;
int x_phase_shift = 16 - x_phase_bits;
int y_phase_shift = 16 - y_phase_bits;
pixman_fixed_t *y_params;
int32_t x1, y1, y2;
int32_t px, py;
int i, j;
px = bits_image_fetch_pixel_separable_convolution_x & 0xffff >> x_phase_shift;
py = bits_image_fetch_pixel_separable_convolution_y & 0xffff >> y_phase_shift;
y_params = params + 4 + (1 < x_phase_bits) * cwidth + py * cheight;
x1 = (bits_image_fetch_pixel_separable_convolution_x - - bits_image_fetch_pixel_separable_convolution_x_off) > 16;
y1 = (bits_image_fetch_pixel_separable_convolution_y - - bits_image_fetch_pixel_separable_convolution_y_off) >> 16;
y2 = y1 + cheight;
bits_image_fetch_pixel_separable_convolution_srtot = bits_image_fetch_pixel_separable_convolution_sgtot = bits_image_fetch_pixel_separable_convolution_sbtot = bits_image_fetch_pixel_separable_convolution_satot = 0;
for (i = y1;
i < y2;
++i) {
pixman_fixed_48_16_t fy = *y_params++;
pixman_fixed_t x_params = *(params + 4 + px * cwidth);
if (fy)
for (j = x1;
j < bits_image_fetch_pixel_separable_convolution_x2;
++j) {
pixman_fixed_t fx = x_params++;
int rx = j;
int ry = i;
if (fx) {
uint32_t pixel;
if (repeat_mode != PIXMAN_REPEAT_NONE)
repeat ( &rx, width);
repeat ( &ry, height);
pixel = 0;
bits_image_fetch_pixel_separable_convolution_satot += pixel >> 8 * 3 * bits_image_fetch_pixel_separable_convolution_f;
}
}
}
return bits_image_fetch_pixel_separable_convolution_satot << 24 | bits_image_fetch_pixel_separable_convolution_srtot << 16 | bits_image_fetch_pixel_separable_convolution_sgtot << 8 | bits_image_fetch_pixel_separable_convolution_sbtot;
}
bits_image_t bits_image_fetch_pixel_filtered_image;
pixman_fixed_t bits_image_fetch_pixel_filtered_x;
pixman_fixed_t bits_image_fetch_pixel_filtered_y;
static __inline__ __attribute__ ((__always_inline__)) uint32_t bits_image_fetch_pixel_filtered ( get_pixel_t get_pixel) {
switch (bits_image_fetch_pixel_filtered_image.common.filter) {
case PIXMAN_FILTER_NEAREST: case PIXMAN_FILTER_FAST: return bits_image_fetch_pixel_nearest ( get_pixel);
case PIXMAN_FILTER_SEPARABLE_CONVOLUTION: return bits_image_fetch_pixel_separable_convolution ( );
default: break;
}
return 0;
}
pixman_fixed_t bits_image_fetch_affine_no_alpha_ux;
pixman_fixed_t bits_image_fetch_affine_no_alpha_uy;
pixman_vector_t bits_image_fetch_affine_no_alpha_v;
int bits_image_fetch_affine_no_alpha_i;
static uint32_t * bits_image_fetch_affine_no_alpha (pixman_iter_t * iter, const uint32_t * mask) {
pixman_image_t image = *(iter->image);
int offset = iter->x;
int line = iter->y++;
int width = iter->width;
uint32_t * buffer = &iter->buffer;
pixman_fixed_t x, y;
bits_image_fetch_affine_no_alpha_v.vector[0] = (offset << 16) + (1 << 16) / 2;
bits_image_fetch_affine_no_alpha_v.vector[1] = (line << 16) + (1 << 16) / 2;
if (image.common.transform)
x = bits_image_fetch_affine_no_alpha_v.vector[0];
for (bits_image_fetch_affine_no_alpha_i = 0;
bits_image_fetch_affine_no_alpha_i < width;
++bits_image_fetch_affine_no_alpha_i) {
x += bits_image_fetch_affine_no_alpha_ux;
y += bits_image_fetch_affine_no_alpha_uy;
}
return buffer;
}
static __inline__ __attribute__ ((__always_inline__)) uint32_t fetch_pixel_general (bits_image_t *image, int x, int y, pixman_bool_t check_bounds) {
uint32_t pixel;
if (check_bounds && (x = image->width || y < 0 || y >= image->height))
return 0;
return pixel;
}
pixman_fixed_t bits_image_fetch_general_ux;
pixman_fixed_t bits_image_fetch_general_uy;
pixman_fixed_t bits_image_fetch_general_uw;
pixman_vector_t bits_image_fetch_general_v;
int bits_image_fetch_general_i;
pixman_fixed_t bits_image_fetch_general_x0;
pixman_fixed_t bits_image_fetch_general_y0;
static uint32_t * bits_image_fetch_general (pixman_iter_t *iter, const uint32_t *mask) {
pixman_image_t image = *(iter->image);
int offset = iter->x;
int line = iter->y++;
int width = iter->width;
uint32_t * buffer = &iter->buffer;
pixman_fixed_t x, y, w;
bits_image_fetch_general_v.vector[0] = (offset << 16) + (1 << 16) / 2;
bits_image_fetch_general_v.vector[1] = (line << 16) + (1 << 16) / 2;
if (image.common.transform)
if (!_moz_pixman_transform_point_3d ( )) return buffer;
for (bits_image_fetch_general_i = 0;
bits_image_fetch_general_i < width;
++bits_image_fetch_general_i) {
if (!mask || mask[bits_image_fetch_general_i])
if (w != 0) ;
buffer[bits_image_fetch_general_i] = bits_image_fetch_pixel_filtered ( fetch_pixel_general);
x += bits_image_fetch_general_ux;
y += bits_image_fetch_general_uy;
w += bits_image_fetch_general_uw;
}
return buffer;
}
typedef uint32_t * convert_pixel_t ;
static uint32_t * bits_image_fetch_nearest_affine_pad_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_pad_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_pad_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_none_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_none_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_none_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_reflect_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_reflect_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_reflect_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_normal_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_normal_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_normal_a8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_pad_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_pad_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_pad_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_none_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_none_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_none_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_reflect_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_reflect_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_reflect_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_normal_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_normal_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_normal_x8r8g8b8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_pad_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_pad_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_pad_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_none_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_none_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_none_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_reflect_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_reflect_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_reflect_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_normal_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_normal_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_normal_a8 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_pad_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_pad_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_pad_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_none_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_none_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_none_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_reflect_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_reflect_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_reflect_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_nearest_affine_normal_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_bilinear_affine_normal_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
static uint32_t * bits_image_fetch_separable_convolution_affine_normal_r5g6b5 (pixman_iter_t *iter, const uint32_t * mask) {
return &iter->buffer;
}
uint32_t replicate_pixel_32_color;
uint32_t *replicate_pixel_32_end;
bits_image_t replicate_pixel_32_bits;
int replicate_pixel_32_x;
int replicate_pixel_32_y;
int replicate_pixel_32_width;
uint32_t * replicate_pixel_32_buffer;
argb_t replicate_pixel_float_color;
argb_t *replicate_pixel_float_end;
bits_image_t replicate_pixel_float_bits;
int replicate_pixel_float_x;
int replicate_pixel_float_y;
int replicate_pixel_float_width;
uint32_t replicate_pixel_float_b;
bits_image_t bits_image_fetch_untransformed_repeat_none_image;
pixman_bool_t bits_image_fetch_untransformed_repeat_none_wide;
uint32_t bits_image_fetch_untransformed_repeat_none_buffer;
static void bits_image_fetch_untransformed_repeat_none ( int x, int y, int width) {
}
uint32_t bits_image_fetch_untransformed_repeat_normal_w;
bits_image_t bits_image_fetch_untransformed_repeat_normal_image;
pixman_bool_t bits_image_fetch_untransformed_repeat_normal_wide;
uint32_t bits_image_fetch_untransformed_repeat_normal_buffer;
static void bits_image_fetch_untransformed_repeat_normal ( int x, int y, int width) {
if (bits_image_fetch_untransformed_repeat_normal_image.width == 1) {
if (bits_image_fetch_untransformed_repeat_normal_wide) {
{
argb_t *buffer = (argb_t *)&replicate_pixel_float_b;
replicate_pixel_float_end = buffer + replicate_pixel_float_width;
while (buffer < replicate_pixel_float_end) *buffer++ = replicate_pixel_float_color;
}
;
}
else {
{
replicate_pixel_32_color = 0;
replicate_pixel_32_end = replicate_pixel_32_buffer + replicate_pixel_32_width;
while (replicate_pixel_32_buffer < replicate_pixel_32_end) *replicate_pixel_32_buffer++ = replicate_pixel_32_color;
}
;
}
if (bits_image_fetch_untransformed_repeat_normal_wide) bits_image_fetch_untransformed_repeat_normal_image.fetch_scanline_float ((pixman_image_t *)&bits_image_fetch_untransformed_repeat_normal_image, x, y, bits_image_fetch_untransformed_repeat_normal_w, &bits_image_fetch_untransformed_repeat_normal_buffer, 0);
}
}
static uint32_t * bits_image_fetch_untransformed_32 (pixman_iter_t * iter, const uint32_t *mask) {
pixman_image_t image = *(iter->image);
int x = iter->x;
int y = iter->y;
int width = iter->width;
uint32_t * buffer = &iter->buffer;
if (image.common.repeat == PIXMAN_REPEAT_NONE)
bits_image_fetch_untransformed_repeat_normal ( x, y, width);
return buffer;
}
static uint32_t * bits_image_fetch_untransformed_float (pixman_iter_t * iter, const uint32_t *mask) {
pixman_image_t image = *(iter->image);
int x = iter->x;
int y = iter->y;
int width = iter->width;
uint32_t * buffer = &iter->buffer;
if (image.common.repeat == PIXMAN_REPEAT_NONE)
bits_image_fetch_untransformed_repeat_none ( x, y, width);
return buffer;
}
typedef struct {
pixman_format_code_t format;
uint32_t flags;
pixman_iter_get_scanline_t get_scanline_32;
pixman_iter_get_scanline_t get_scanline_float;
}
fetcher_info_t;
static const fetcher_info_t fetcher_info[] = {
{
0 << 24 | 5 << 16 | 0 << 12 | 0 << 8 | 0 << 4 | 0, 1 << 1 | 1 << 0 | 1 << 2 | 1 << 3 | 1 << 4, bits_image_fetch_untransformed_32, bits_image_fetch_untransformed_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 16 | 1 << 18 | 1 << 14 | 1 << 3 | 1 << 4 | 1 << 19, bits_image_fetch_bilinear_no_repeat_8888, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_separable_convolution_affine_pad_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_bilinear_affine_pad_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_nearest_affine_pad_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_none_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_none_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_none_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_separable_convolution_affine_reflect_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_bilinear_affine_reflect_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_nearest_affine_reflect_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_normal_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_normal_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_normal_a8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_separable_convolution_affine_pad_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_bilinear_affine_pad_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_nearest_affine_pad_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_none_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_none_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_none_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_separable_convolution_affine_reflect_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_bilinear_affine_reflect_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_nearest_affine_reflect_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_normal_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_normal_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_x8r8g8b8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_normal_x8r8g8b8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_separable_convolution_affine_pad_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_bilinear_affine_pad_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_nearest_affine_pad_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_none_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_none_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_none_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_separable_convolution_affine_reflect_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_bilinear_affine_reflect_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_nearest_affine_reflect_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_normal_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_normal_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_a8, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_normal_a8, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_separable_convolution_affine_pad_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_bilinear_affine_pad_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 4, bits_image_fetch_nearest_affine_pad_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_none_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_none_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 14 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_none_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_separable_convolution_affine_reflect_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_bilinear_affine_reflect_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 14 | 1 << 3, bits_image_fetch_nearest_affine_reflect_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 26 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_separable_convolution_affine_normal_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 19 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_bilinear_affine_normal_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
PIXMAN_r5g6b5, 1 << 1 | 1 << 5 | 1 << 12 | 1 << 17 | 1 << 11 | 1 << 15 | 1 << 3 | 1 << 4, bits_image_fetch_nearest_affine_normal_r5g6b5, _pixman_image_get_scanline_generic_float }
, {
0 << 24 | 5 << 16 | 0 << 12 | 0 << 8 | 0 << 4 | 0, 1 << 1 | 1 << 12 | 1 << 17, bits_image_fetch_affine_no_alpha, _pixman_image_get_scanline_generic_float }
, {
0 << 24 | 5 << 16 | 0 << 12 | 0 << 8 | 0 << 4 | 0, 0, bits_image_fetch_general, _pixman_image_get_scanline_generic_float }
, };
pixman_image_t * bits_image_property_changed_image;
static void bits_image_property_changed (void) {
}
const fetcher_info_t *_pixman_bits_image_src_iter_init_info;
const uint32_t _pixman_bits_image_src_iter_init_info_1;
pixman_image_t _pixman_bits_image_src_iter_init_image;
pixman_iter_t _pixman_bits_image_src_iter_init_iter;
void _pixman_bits_image_src_iter_init ( void) {
pixman_format_code_t format = _pixman_bits_image_src_iter_init_image.common.extended_format_code;
uint32_t flags = _pixman_bits_image_src_iter_init_image.common.flags;
for (_pixman_bits_image_src_iter_init_info = fetcher_info;
_pixman_bits_image_src_iter_init_info->format != (0 << 24 | 0 << 16 | 0 << 12 | 0 << 8 | 0 << 4 | 0);
++_pixman_bits_image_src_iter_init_info)
if ((_pixman_bits_image_src_iter_init_info->format == format || _pixman_bits_image_src_iter_init_info->format == (0 << 24 | 5 << 16 | 0 << 12 | 0 << 8 | 0 << 4 | 0)) && (_pixman_bits_image_src_iter_init_info_1 & flags) == _pixman_bits_image_src_iter_init_info_1) ;
}
static uint32_t * dest_get_scanline_16 (pixman_iter_t *iter, const uint32_t *mask) {
pixman_image_t image = *(iter->image);
int x = iter->x;
int y = iter->y;
int width = iter->width;
uint32_t buffer = iter->buffer;
image.bits.fetch_scanline_16 (&image, x, y, width, &buffer, mask);
return &iter->buffer;
}
static uint32_t * dest_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) {
pixman_image_t *image = iter->image;
int x = iter->x;
int y = iter->y;
int width = iter->width;
uint32_t buffer = iter->buffer;
image->bits.fetch_scanline_32 (image, x, y, width, &buffer, mask);
return &iter->buffer;
}
static uint32_t * dest_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask) {
bits_image_t image = iter->image->bits;
int x = iter->x;
int y = iter->y;
int width = iter->width;
argb_t * buffer = (argb_t *)&iter->buffer;
image.fetch_scanline_float ( (pixman_image_t *)&image, x, y, width, (uint32_t *)buffer, mask);
return &iter->buffer;
}
pixman_iter_t dest_write_back_16_iter;
static void dest_write_back_16 (void) {
bits_image_t image = dest_write_back_16_iter.image->bits;
int x = dest_write_back_16_iter.x;
int y = dest_write_back_16_iter.y;
int width = dest_write_back_16_iter.width;
const uint32_t *buffer = &dest_write_back_16_iter.buffer;
image.store_scanline_16 (&image, x, y, width, buffer);
}
pixman_iter_t dest_write_back_narrow_iter;
static void dest_write_back_narrow (void) {
bits_image_t image = dest_write_back_narrow_iter.image->bits;
int x = dest_write_back_narrow_iter.x;
int y = dest_write_back_narrow_iter.y;
int width = dest_write_back_narrow_iter.width;
const uint32_t buffer = dest_write_back_narrow_iter.buffer;
image.store_scanline_32 (&image, x, y, width, &buffer);
}
pixman_iter_t dest_write_back_wide_iter;
static void dest_write_back_wide (void) {
}
pixman_image_t * _pixman_bits_image_dest_iter_init_image;
pixman_iter_t _pixman_bits_image_dest_iter_init_iter;
void _pixman_bits_image_dest_iter_init ( void) {
if (_pixman_bits_image_dest_iter_init_iter.iter_flags & ITER_16) {
if ((_pixman_bits_image_dest_iter_init_iter.iter_flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) == (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA))
_pixman_bits_image_dest_iter_init_iter.get_scanline = dest_get_scanline_16;
_pixman_bits_image_dest_iter_init_iter.write_back = dest_write_back_16;
if ((_pixman_bits_image_dest_iter_init_iter.iter_flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) == (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA))
_pixman_bits_image_dest_iter_init_iter.get_scanline = dest_get_scanline_narrow;
_pixman_bits_image_dest_iter_init_iter.write_back = dest_write_back_narrow;
}
else
_pixman_bits_image_dest_iter_init_iter.get_scanline = dest_get_scanline_wide;
_pixman_bits_image_dest_iter_init_iter.write_back = dest_write_back_wide;
}
int create_bits_stride;
size_t create_bits_buf_size;
int create_bits_bpp;
pixman_format_code_t create_bits_format;
int create_bits_width;
int create_bits_height;
int * create_bits_rowstride_bytes;
pixman_bool_t create_bits_clear;
uint32_t *_pixman_bits_image_init_free_me = 0;
int _pixman_bits_image_init_rowstride_bytes;
pixman_image_t * _pixman_bits_image_init_image;
pixman_format_code_t _pixman_bits_image_init_format;
int _pixman_bits_image_init_width;
int _pixman_bits_image_init_height;
uint32_t * _pixman_bits_image_init_bits;
int _pixman_bits_image_init_rowstride;
pixman_bool_t _pixman_bits_image_init_clear;
pixman_bool_t _pixman_bits_image_init ( void) {
uint32_t *__trans_tmp_1;
if (!_pixman_bits_image_init_bits && _pixman_bits_image_init_width && _pixman_bits_image_init_height) {
{
create_bits_bpp = create_bits_format >> 24 ;
create_bits_stride = create_bits_width * create_bits_bpp;
create_bits_buf_size = create_bits_height * create_bits_stride;
if (create_bits_clear) __trans_tmp_1 = 0;
else __trans_tmp_1 = malloc (create_bits_buf_size);
}
_pixman_bits_image_init_free_me = _pixman_bits_image_init_bits = __trans_tmp_1;
}
_pixman_bits_image_init_image->bits.free_me = _pixman_bits_image_init_free_me;
_pixman_bits_image_init_image->common.property_changed = bits_image_property_changed;
return 1;
}
// this should reproduce the crash:
// /var/tmp/creduce/creduce/../clang_delta/clang_delta --transformation=copy-propagation --counter=1 /var/tmp/moz-build-dir/gfx/cairo/libpixman/src/clang_delta_crash_tmp_filejozDcb.i