VirtualBox

Changeset 15677 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Dec 19, 2008 9:26:23 AM (16 years ago)
Author:
vboxsync
Message:

Don't touch freed memory. Added some more error checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r14755 r15677  
    58445844        if (    RT_FAILURE(rc)
    58455845            ||  !(CpuOld.pCurInstr->optype & OPTYPE_HARMLESS))
     5846        {
     5847            if (RT_SUCCESS(rc))
     5848                cbDirty += CpuOld.opsize;
     5849            else
     5850            if (!cbDirty)
     5851                cbDirty = 1;
    58465852            break;
     5853        }
    58475854
    58485855#ifdef DEBUG
     
    58525859        Log(("DIRTY: %s\n", szBuf));
    58535860#endif
     5861        /* Mark as clean; if we fail we'll let it always fault. */
     5862        pRec->fDirty      = false;
     5863
    58545864        /** Remove old lookup record. */
    58555865        patmr3RemoveP2GLookupRecord(pVM, &pPatch->patch, pCurPatchInstrGC);
     
    58575867        pCurPatchInstrGC += CpuOld.opsize;
    58585868        cbDirty          += CpuOld.opsize;
    5859 
    5860         /* Mark as clean; if we fail we'll let it always fault. */
    5861         pRec->fDirty      = false;
    58625869
    58635870        /* Let's see if there's another dirty instruction right after. */
     
    59535960    {
    59545961        STAM_COUNTER_INC(&pVM->patm.s.StatInstrDirtyBad);
     5962        Assert(cbDirty);
     5963
    59555964        /* Mark the whole instruction stream with breakpoints. */
    5956         memset(pPatchInstrHC, 0xCC, cbDirty);
     5965        if (cbDirty)
     5966            memset(pPatchInstrHC, 0xCC, cbDirty);
    59575967
    59585968        if (    pVM->patm.s.fOutOfMemory == false
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette