pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:1598:    shl_reg_imm(P_REG_RAX, 16);    add_reg_imm(P_REG_RAX, PIKE_T_FUNCTION);    mov_reg_mem(P_REG_RAX, sp_reg, OFFSETOF(svalue, tu.t.type));    amd64_add_sp(1);   }      void amd64_update_pc(void)   {    INT32 tmp = PIKE_PC, disp;    const enum amd64_reg tmp_reg = P_REG_RAX; + #ifdef PIKE_AMD64_VALIDATE_RSP +  LABELS(); + #endif       if(amd64_prev_stored_pc == - 1)    {    amd64_load_fp_reg();    mov_rip_imm_reg(tmp - PIKE_PC, tmp_reg);    mov_reg_mem(tmp_reg, fp_reg, OFFSETOF(pike_frame, pc));   #ifdef PIKE_DEBUG    if (a_flag >= 60)    fprintf (stderr, "pc %d update pc via lea\n", tmp);   #endif
pike.git/src/code/amd64.c:1629:    /* amd64_load_fp_reg(); */    /* add_imm_mem(disp, fp_reg, OFFSETOF (pike_frame, pc)); */    amd64_prev_stored_pc += disp;    }    else {   #ifdef PIKE_DEBUG    if (a_flag >= 60)    fprintf (stderr, "pc %d update pc - already up-to-date\n", tmp);   #endif    } +  + #ifdef PIKE_AMD64_VALIDATE_RSP +  mov_reg_reg(P_REG_RSP, tmp_reg); +  and_reg_imm(tmp_reg, 0x0f); +  je(&label_A); +  /* Broken RSP */ +  call_reg(tmp_reg); /* Jump to zero-page should trigger a SIGSEGV. */ +  LABEL_A; + #endif   }         static void maybe_update_pc(void)   {    static int last_prog_id=-1;    static size_t last_num_linenumbers=-1;    if( !store_pc ) return;       if(