Enable the CHECK for near-jump displacement range in Release mode too.

If we're generating bad code anyway, we might as well crash immediately and at least get a proper backtrace.

Review URL: https://chromiumcodereview.appspot.com/10697004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent df35732a
......@@ -1373,7 +1373,7 @@ void Assembler::bind_to(Label* L, int pos) {
ASSERT(offset_to_next <= 0);
// Relative address, relative to point after address.
int disp = pos - fixup_pos - sizeof(int8_t);
ASSERT(0 <= disp && disp <= 127);
CHECK(0 <= disp && disp <= 127);
set_byte_at(fixup_pos, disp);
if (offset_to_next < 0) {
L->link_to(fixup_pos + offset_to_next, Label::kNear);
......
......@@ -467,7 +467,7 @@ void Assembler::bind_to(Label* L, int pos) {
static_cast<int>(*reinterpret_cast<int8_t*>(addr_at(fixup_pos)));
ASSERT(offset_to_next <= 0);
int disp = pos - (fixup_pos + sizeof(int8_t));
ASSERT(is_int8(disp));
CHECK(is_int8(disp));
set_byte_at(fixup_pos, disp);
if (offset_to_next < 0) {
L->link_to(fixup_pos + offset_to_next, Label::kNear);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment