VirtualBox

Changeset 108235 in vbox


Ignore:
Timestamp:
Feb 16, 2025 2:24:41 PM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167556
Message:

Runtime/RTAcpi*: Implement constant folding for ShiftLeft (used by vbox.dsl), bugref:10733 [build fix + memory leak fixes]

Location:
trunk/src/VBox/Runtime/common/acpi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/acpi/acpi-ast.cpp

    r108234 r108235  
    8787DECLHIDDEN(void) rtAcpiAstNodeFree(PRTACPIASTNODE pAstNd)
    8888{
    89     /** @todo */
     89    /* Free all the arguments first. */
     90    for (uint8_t i = 0; i < pAstNd->cArgs; i++)
     91    {
     92        if (   pAstNd->aArgs[i].enmType == kAcpiAstArgType_AstNode
     93            && pAstNd->aArgs[i].u.pAstNd)
     94            rtAcpiAstNodeFree(pAstNd->aArgs[i].u.pAstNd);
     95    }
     96
     97    if (pAstNd->fFlags & RTACPI_AST_NODE_F_NEW_SCOPE)
     98    {
     99        PRTACPIASTNODE pIt, pItNext;
     100        /* Do transformations on the nodes first. */
     101        RTListForEachSafe(&pAstNd->LstScopeNodes, pIt, pItNext, RTACPIASTNODE, NdAst)
     102        {
     103            RTListNodeRemove(&pIt->NdAst);
     104            rtAcpiAstNodeFree(pIt);
     105        }
     106    }
     107
     108    pAstNd->enmOp  = kAcpiAstNodeOp_Invalid;
     109    pAstNd->cArgs  = 0;
     110    pAstNd->fFlags = 0;
    90111    RTMemFree(pAstNd);
    91112}
  • trunk/src/VBox/Runtime/common/acpi/acpi-compiler.cpp

    r108234 r108235  
    30193019                    if (RT_SUCCESS(rc))
    30203020                    {
    3021                         pIt;
    30223021                        RTListForEach(&pThis->LstStmts, pIt, RTACPIASTNODE, NdAst)
    30233022                        {
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