Permalink
Browse files

eval: fix overflow error in fwd

  • Loading branch information...
hellerve committed Nov 18, 2018
1 parent 6d1da56 commit f29d163a8e5c441224b0e6938f9e95bce884317a
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/eval.c
@@ -45,7 +45,7 @@ do_bck: h--; DISPATCH();
#else
// modulo would be prettier here, but slows the code down by A LOT; somehow
// the C compilers can’t optimize uncoditional modulos here
do_fwd: h = h > TAPE_LEN-1 ? 0 : h+1; DISPATCH();
do_fwd: h = h == TAPE_LEN-1 ? 0 : h+1; DISPATCH();
do_bck: h = h == 0 ? TAPE_LEN-1 : h-1; DISPATCH();
#endif
do_prn: printf("%c", t[h]); DISPATCH();

0 comments on commit f29d163

Please sign in to comment.