diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..93b54e4 --- /dev/null +++ b/BUGS @@ -0,0 +1,4 @@ +Failures on Fedora x86_64, reported by postmodern +http://rafb.net/p/4L3z3Y69.html +http://rafb.net/p/zp9cth25.html +http://rafb.net/p/NYeXnd29.html diff --git a/vm/config.h b/vm/config.h index 55874bb..8da3dde 100644 --- a/vm/config.h +++ b/vm/config.h @@ -13,4 +13,14 @@ /* enable CallSite optimization */ #define TR_CALL_SITE -#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ \ No newline at end of file +#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ + +/* TR_BITSINT defines the number of bits in an int. */ +#if INT_MAX-20 < 32760 +#define TR_BITSINT 16 +#elif INT_MAX > 2147483640L +/* int has at least 32 bits */ +#define TR_BITSINT 32 +#else +#error "you must define TR_BITSINT with number of bits in an integer" +#endif diff --git a/vm/opcode.h b/vm/opcode.h index bafa474..2525246 100644 --- a/vm/opcode.h +++ b/vm/opcode.h @@ -15,8 +15,13 @@ #define POS_B (POS_C + SIZE_C) #define POS_Bx POS_C +#if SIZE_Bx < TR_BITSINT-1 #define MAXARG_Bx ((1<>1) /* `sBx' is signed */ +#else +#define MAXARG_Bx MAX_INT +#define MAXARG_sBx MAX_INT +#endif /* creates a mask with `n' 1 bits at position `p' */ #define MASK1(n,p) ((~((~(TrInst)0)<