Add sanity check
parent
a271b84bba
commit
9d80b13932
|
@ -70,6 +70,11 @@ INLINE void reloc_set_2_2(CELL cell, CELL value)
|
||||||
/* Store a value into a bitfield of a PowerPC instruction */
|
/* Store a value into a bitfield of a PowerPC instruction */
|
||||||
INLINE void reloc_set_masked(CELL cell, F_FIXNUM value, CELL mask, F_FIXNUM shift)
|
INLINE void reloc_set_masked(CELL cell, F_FIXNUM value, CELL mask, F_FIXNUM shift)
|
||||||
{
|
{
|
||||||
|
/* This is unaccurate but good enough */
|
||||||
|
F_FIXNUM test = (F_FIXNUM)mask >> 1;
|
||||||
|
if(value <= -test || value >= test)
|
||||||
|
critical_error("Value does not fit inside relocation",0);
|
||||||
|
|
||||||
u32 original = *(u32*)cell;
|
u32 original = *(u32*)cell;
|
||||||
original &= ~mask;
|
original &= ~mask;
|
||||||
*(u32*)cell = (original | ((value >> shift) & mask));
|
*(u32*)cell = (original | ((value >> shift) & mask));
|
||||||
|
|
|
@ -111,6 +111,7 @@ void print_stack_frame(F_STACK_FRAME *frame)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
print_obj(frame_scan(frame));
|
print_obj(frame_scan(frame));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
printf("%lx\n",(CELL)frame->xt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_callstack(void)
|
void print_callstack(void)
|
||||||
|
|
Loading…
Reference in New Issue