Permalink
Browse files

More helpful error message for out-of-range jumps

  • Loading branch information...
1 parent d984b15 commit 9925bb4435476c7c939b7e06bdf72813f9666247 @nominolo committed Oct 12, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 vm/assembler.cc
View
@@ -50,7 +50,13 @@ SpillSet::allocSpillHigh()
static inline int32_t jmprel(MCode *p, MCode *target) {
ptrdiff_t delta = target - p;
- LC_ASSERT(delta == (int32_t)delta);
+ if (!(delta == (int32_t)delta)) {
+ cerr << "FATAL: jmprel: Target out of range p="
+ << (void*)p << " target=" << (void*)target
+ << " delta=" << delta << endl;
+ LC_ASSERT(0 && "jmprel target out of range");
+ exit(1);
+ }
return (int32_t)delta;
}

0 comments on commit 9925bb4

Please sign in to comment.