VirtualBox

Changeset 102581 in vbox


Ignore:
Timestamp:
Dec 12, 2023 8:45:11 AM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160729
Message:

VMM/IEM: The IEM_MC*_PUSH_* MCs implictly frees the variable they're passed. The emitter code was already doing this, but the free call and python checks were missing. bugref:10371

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8vePython.py

    r102579 r102581  
    385385                            del dVars[sParam];
    386386                        else:
    387                             self.raiseProblem('Variable %s was used after implictly frees by %s!' % (sParam, oStmt.sName,));
     387                            self.raiseProblem('Variable %s was used after implictly freed by %s!' % (sParam, oStmt.sName,));
     388
     389                elif oStmt.sName in ('IEM_MC_PUSH_U16', 'IEM_MC_PUSH_U32', 'IEM_MC_PUSH_U32_SREG', 'IEM_MC_PUSH_U64',
     390                                     'IEM_MC_FLAT32_PUSH_U16', 'IEM_MC_FLAT32_PUSH_U32', 'IEM_MC_FLAT32_PUSH_U32_SREG',
     391                                     'IEM_MC_FLAT64_PUSH_U16', 'IEM_MC_FLAT64_PUSH_U64',):
     392                    #
     393                    # The variable being pushed is implicitly freed.
     394                    #
     395                    for sParam in oStmt.asParams:
     396                        oVarInfo = dVars.get(sParam);
     397                        if oVarInfo:
     398                            dFreedVars[sParam] = oVarInfo;
     399                            del dVars[sParam];
     400                        else:
     401                            self.raiseProblem('Variable %s was used after implictly freed by %s!' % (sParam, oStmt.sName,));
    388402                else:
    389403                    #
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r102579 r102581  
    1002710027    /* Done setting up parameters, make the call. */
    1002810028    off = iemNativeEmitCallImm(pReNative, off, pfnFunction);
     10029
     10030    /* The value variable is implictly flushed. */
     10031    iemNativeVarFreeLocal(pReNative, idxVarValue);
    1002910032
    1003010033    iemNativeLabelDefine(pReNative, idxLabelTlbDone, off);
Note: See TracChangeset for help on using the changeset viewer.

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