Index: /trunk/src/VBox/VMM/PATM/PATM.cpp
===================================================================
--- /trunk/src/VBox/VMM/PATM/PATM.cpp	(revision 25776)
+++ /trunk/src/VBox/VMM/PATM/PATM.cpp	(revision 25777)
@@ -186,10 +186,10 @@
      * Debugger commands.
      */
-    static bool fRegisteredCmds = false;
-    if (!fRegisteredCmds)
-    {
-        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
-        if (RT_SUCCESS(rc))
-            fRegisteredCmds = true;
+    static bool s_fRegisteredCmds = false;
+    if (!s_fRegisteredCmds)
+    {
+        int rc2 = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
+        if (RT_SUCCESS(rc2))
+            s_fRegisteredCmds = true;
     }
 #endif
@@ -1703,5 +1703,5 @@
         RTRCPTR pNextInstrGC = 0;   /* by default no inhibit irq */
 
-        /** In a sequence of instructions that inhibit irqs, only the first one actually inhibits irqs. */
+        /* In a sequence of instructions that inhibit irqs, only the first one actually inhibits irqs. */
         if (!(pPatch->flags & PATMFL_INHIBIT_IRQS))
         {
@@ -1718,5 +1718,5 @@
             unsigned    opsize;
             int         disret;
-            RCPTRTYPE(uint8_t *) pNextInstrGC, pReturnInstrGC;
+            RCPTRTYPE(uint8_t *) pReturnInstrGC;
             R3PTRTYPE(uint8_t *) pNextInstrHC;
 
@@ -2574,9 +2574,5 @@
     if (rc == VINF_SUCCESS)
     {
-        DISCPUSTATE cpu;
-        char szOutput[256];
-        uint32_t opsize, i = 0;
-        bool disret;
-
+        i = 0;
         while(i < pPatch->cbPrivInstr)
         {
@@ -3267,20 +3263,20 @@
             if (pPatchPage->aPatch[i])
             {
-                PPATCHINFO pPatch = pPatchPage->aPatch[i];
-
-                if (    (pPatch->flags & PATMFL_DUPLICATE_FUNCTION)
-                    &&  pPatch->uState == PATCH_ENABLED)
+                PPATCHINFO pPatch2 = pPatchPage->aPatch[i];
+
+                if (    (pPatch2->flags & PATMFL_DUPLICATE_FUNCTION)
+                    &&  pPatch2->uState == PATCH_ENABLED)
                 {
-                    pPatchTargetGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pInstrGC);
+                    pPatchTargetGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch2, pInstrGC);
                     if (pPatchTargetGC)
                     {
                         uint32_t         offsetPatch      = pPatchTargetGC - pVM->patm.s.pPatchMemGC;
-                        PRECPATCHTOGUEST pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32GetBestFit(&pPatch->Patch2GuestAddrTree, offsetPatch, false);
+                        PRECPATCHTOGUEST pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32GetBestFit(&pPatch2->Patch2GuestAddrTree, offsetPatch, false);
                         Assert(pPatchToGuestRec);
 
                         pPatchToGuestRec->fJumpTarget = true;
-                        Assert(pPatchTargetGC != pPatch->pPrivInstrGC);
-                        Log(("patmCreateTrampoline: generating jump to code inside patch at %RRv\n", pPatch->pPrivInstrGC));
-                        pPatch->flags |= PATMFL_EXTERNAL_JUMP_INSIDE;
+                        Assert(pPatchTargetGC != pPatch2->pPrivInstrGC);
+                        Log(("patmCreateTrampoline: generating jump to code inside patch at %RRv\n", pPatch2->pPrivInstrGC));
+                        pPatch2->flags |= PATMFL_EXTERNAL_JUMP_INSIDE;
                         break;
                     }
@@ -5235,6 +5231,6 @@
 
                     // let's first check if the guest code is still the same
-                    int rc = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
-                    AssertRC(rc);
+                    int rc2 = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
+                    AssertRC(rc2);
 
                     if (memcmp(temp, pPatch->aPrivInstr, pPatch->cbPatchJump))
@@ -5248,8 +5244,8 @@
                     }
 
-                    rc = patmGenJumpToPatch(pVM, pPatch, false);
-                    AssertRC(rc);
-                    if (RT_FAILURE(rc))
-                        return rc;
+                    rc2 = patmGenJumpToPatch(pVM, pPatch, false);
+                    AssertRC(rc2);
+                    if (RT_FAILURE(rc2))
+                        return rc2;
 
 #ifdef DEBUG
@@ -5274,6 +5270,6 @@
 
                 /* Let's first check if the guest code is still the same. */
-                int rc = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
-                AssertRC(rc);
+                int rc2 = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
+                AssertRC(rc2);
 
                 if (memcmp(temp, pPatch->aPrivInstr, pPatch->cbPatchJump))
@@ -5286,7 +5282,7 @@
                 }
 
-                rc = patmActivateInt3Patch(pVM, pPatch);
-                if (RT_FAILURE(rc))
-                    return rc;
+                rc2 = patmActivateInt3Patch(pVM, pPatch);
+                if (RT_FAILURE(rc2))
+                    return rc2;
             }
 
@@ -5631,5 +5627,5 @@
     if (pPatch->flags & PATMFL_CODE_MONITORED)
     {
-        int rc = patmRemovePatchPages(pVM, pPatch);
+        rc = patmRemovePatchPages(pVM, pPatch);
         AssertRCReturn(rc, rc);
     }
@@ -6197,9 +6193,9 @@
         {
             RTRCPTR retaddr;
-            PCPUMCTX pCtx;
-
-            pCtx = CPUMQueryGuestCtxPtr(pVCpu);
-
-            rc = PGMPhysSimpleReadGCPtr(pVCpu,  &retaddr, pCtx->esp, sizeof(retaddr));
+            PCPUMCTX pCtx2;
+
+            pCtx2 = CPUMQueryGuestCtxPtr(pVCpu);
+
+            rc = PGMPhysSimpleReadGCPtr(pVCpu,  &retaddr, pCtx2->esp, sizeof(retaddr));
             AssertRC(rc);
 
