Changeset 7e4bd9b6 for src/Virtual


Ignore:
Timestamp:
Jun 14, 2023, 4:43:21 PM (23 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
1e940de0
Parents:
5668740
Message:

updated actor-related passes to fix some bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Virtual/VirtualDtor.cpp

    r5668740 r7e4bd9b6  
    146146
    147147            CompoundStmt * dtorBody = mutate( decl->stmts.get() );
    148             // Adds the following to the end of any actor/message dtor:
     148            // Adds the following to the start of any actor/message dtor:
    149149            //  __CFA_dtor_shutdown( this );
    150             dtorBody->push_front( new ExprStmt(
    151                 decl->location,
    152                                 new UntypedExpr (
    153                     decl->location,
    154                                         new NameExpr( decl->location, "__CFA_dtor_shutdown" ),
    155                                         {
    156                         new NameExpr( decl->location, decl->params.at(0)->name )
    157                                         }
    158                                 )
    159                         ));
     150            dtorBody->push_front(
     151                new IfStmt( decl->location,
     152                    new UntypedExpr (
     153                        decl->location,
     154                        new NameExpr( decl->location, "__CFA_dtor_shutdown" ),
     155                        {
     156                            new NameExpr( decl->location, decl->params.at(0)->name )
     157                        }
     158                    ),
     159                    new ReturnStmt( decl->location, nullptr )
     160                )
     161            );
    160162            return;
    161163        }
Note: See TracChangeset for help on using the changeset viewer.