Branch: Tag:

2011-05-16

2011-05-16 06:41:03 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler (amd64): Check stack alignment in debug mode.

662:    CLEAR_REGS();   }    + static void amd64_stack_error(void) + { +  Pike_fatal("Stack error\n"); + } +    void amd64_update_pc(void)   {    INT32 tmp = PIKE_PC, disp;
692:   #endif    }    amd64_prev_stored_pc = tmp; + #ifdef PIKE_DEBUG +  if (d_flag) { +  /* Check that the stack keeps being 16 byte aligned. */ +  AMD64_MOV_REG(REG_RSP, REG_RAX); +  AMD64_AND_IMM32(REG_RAX, 0x08); +  AMD64_JE(0x09); +  CALL_ABSOLUTE(amd64_stack_error);    } -  + #endif + }         static void maybe_update_pc(void)