Changeset 496ffc17 for src/Validate


Ignore:
Timestamp:
Feb 1, 2024, 5:05:54 PM (4 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
9ddcee1
Parents:
32490deb
Message:

Fix dangling reference to posE function

Location:
src/Validate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/Autogen.cpp

    r32490deb r496ffc17  
    751751                 * returns to zero.
    752752                 */
    753                 auto dstExpr = new ast::VariableExpr( location, dstParam );
    754                 const ast::Expr * srcExpr;
    755                 if ( decl->base ) {
    756                         srcExpr = new ast::ApplicationExpr( location,
    757                         ast::VariableExpr::functionPointer( location, genPosProto() ),
    758                         {
    759                                 new ast::VariableExpr( location, srcParam )
    760                         }
    761                         );
    762                 } else {
    763                         srcExpr = new ast::VariableExpr( location, srcParam );
    764                 }
    765 
    766753                auto callExpr = new ast::ApplicationExpr( location,
    767754                        ast::VariableExpr::functionPointer( location, functionDecl ),
    768755                        {
    769                                 dstExpr,
    770                                 srcExpr,
     756                                new ast::VariableExpr( location, dstParam ),
     757                                new ast::VariableExpr( location, srcParam )
    771758                        }
    772759                );
  • src/Validate/ReplacePseudoFunc.cpp

    r32490deb r496ffc17  
    128128            location, ast::ConstantExpr::from_string(location, mem->name)));
    129129    }
    130     // Values only
    131130    if (queryValues.count(enumDecl->name)) {
    132131        auto init = new ast::ListInit(location, std::move(inits));
     
    166165    auto untyped = new ast::UntypedExpr(
    167166        location, new ast::NameExpr(location, "?[?]"),
    168         {new ast::VariableExpr(*arrAsVar), new ast::VariableExpr(*arg)});
     167        { std::move(arrAsVar), std::move(arg) });
    169168    auto typedResult = ResolvExpr::findVoidExpression(untyped, context);
    170169
Note: See TracChangeset for help on using the changeset viewer.