VirtualBox

Changeset 41303 in vbox for trunk/src/bldprogs


Ignore:
Timestamp:
May 15, 2012 10:17:39 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77972
Message:

Expansion rescan bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bldprogs/VBoxCPP.cpp

    r41301 r41303  
    523523*******************************************************************************/
    524524static PVBCPPMACRO  vbcppMacroLookup(PVBCPP pThis, const char *pszDefine, size_t cchDefine);
    525 static RTEXITCODE   vbcppMacroExpandIt(PVBCPP pThis, PVBCPPMACROEXP pExp, size_t offMacro, PVBCPPMACRO pMacro, size_t *poffParameters);
     525static RTEXITCODE   vbcppMacroExpandIt(PVBCPP pThis, PVBCPPMACROEXP pExp, size_t offMacro, PVBCPPMACRO pMacro, size_t offParameters);
    526526static RTEXITCODE   vbcppMacroExpandReScan(PVBCPP pThis, PVBCPPMACROEXP pExp, VBCPPMACRORESCANMODE enmMode, size_t *pcReplacements);
    527527static void         vbcppMacroExpandCleanup(PVBCPPMACROEXP pExp);
     
    15781578        rcExit = vbcppStrBufAppendN(&ExpCtx.StrBuf, pchDefine, cchDefine);
    15791579        if (rcExit == RTEXITCODE_SUCCESS)
    1580         {
    1581             size_t offIgnore = cchDefine;
    1582             rcExit = vbcppMacroExpandIt(pThis, &ExpCtx, 0 /* offset */, pMacro, &offIgnore);
    1583         }
     1580            rcExit = vbcppMacroExpandIt(pThis, &ExpCtx, 0 /* offset */, pMacro, cchDefine);
    15841581        if (rcExit == RTEXITCODE_SUCCESS)
    15851582            rcExit = vbcppMacroExpandReScan(pThis, &ExpCtx, kMacroReScanMode_Normal, NULL);
     
    21952192 *                              invocation.
    21962193 * @param   pMacro              The macro.
    2197  * @param   poffParameters      The start of the parameter list if applicable.
    2198  *                              Ignored if not function macro.
    2199  *
    2200  *                              If the parameter list starts at the current stream position shall
    2201  *                              be at the end of the expansion buffer.
    2202  *
    2203  *                              Will be advanced to the character following the
    2204  *                              closing parenthesis on success.  Undefined on
    2205  *                              failure.
     2194 * @param   offParameters       The start of the parameter list if applicable.
     2195 *                              Ignored if not function macro.  If the
     2196 *                              parameter list starts at the current stream
     2197 *                              position shall be at the end of the expansion
     2198 *                              buffer.
    22062199 */
    22072200static RTEXITCODE vbcppMacroExpandIt(PVBCPP pThis, PVBCPPMACROEXP pExp, size_t offMacro, PVBCPPMACRO pMacro,
    2208                                      size_t *poffParameters)
     2201                                     size_t offParameters)
    22092202{
    22102203    RTEXITCODE rcExit;
     
    22172210    if (pMacro->fFunction)
    22182211    {
    2219         rcExit = vbcppMacroExpandGatherParameters(pThis, pExp, poffParameters, pMacro->cArgs + pMacro->fVarArg);
     2212        rcExit = vbcppMacroExpandGatherParameters(pThis, pExp, &offParameters, pMacro->cArgs + pMacro->fVarArg);
    22202213        if (rcExit == RTEXITCODE_SUCCESS)
    22212214        {
     
    22332226            rcExit = vbcppMacroExpandValueWithArguments(pThis, pExp, pMacro, &ValueBuf);
    22342227            if (rcExit == RTEXITCODE_SUCCESS)
    2235                 rcExit = vbcppMacroExpandReplace(pThis, pExp, offMacro, *poffParameters - offMacro,
     2228                rcExit = vbcppMacroExpandReplace(pThis, pExp, offMacro, offParameters - offMacro,
    22362229                                                 ValueBuf.pszBuf, ValueBuf.cchBuf);
    22372230            vbcppStrBufDelete(&ValueBuf);
     
    24462439                && (   !pMacro->fFunction
    24472440                    || vbcppMacroExpandLookForLeftParenthesis(pThis, pExp, &off)) )
    2448                 rcExit = vbcppMacroExpandIt(pThis, pExp, offDefine, pMacro, &off);
     2441            {
     2442                rcExit = vbcppMacroExpandIt(pThis, pExp, offDefine, pMacro, off);
     2443                off = offDefine;
     2444            }
    24492445            else
    24502446            {
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