Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/macournoyer/tinyrb

  • Loading branch information...
commit 299b6473550b68a1ca033856dbd98436dcbd0671 2 parents a874a3d + a362ce6
@singpolyma authored
Showing with 20 additions and 1 deletion.
  1. +4 −0 BUGS
  2. +11 −1 vm/config.h
  3. +5 −0 vm/opcode.h
View
4 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
View
12 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) */
+#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
View
5 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<<SIZE_Bx)-1)
#define MAXARG_sBx (MAXARG_Bx>>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)<<n))<<p)
Please sign in to comment.
Something went wrong with that request. Please try again.