Changeset 29702ad for src/CodeGen


Ignore:
Timestamp:
Nov 22, 2022, 10:18:04 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
20cf96d
Parents:
1553a55 (diff), d41735a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r1553a55 r29702ad  
    290290                                        if ( obj->get_init() ) {
    291291                                                obj->get_init()->accept( *visitor );
    292                                                 last_val = ((ConstantExpr *)(((SingleInit *)(obj->init))->value))->constant.get_ival();
     292                                                Expression* expr = ((SingleInit *)(obj->init))->value;
     293                                                while ( auto temp = dynamic_cast<CastExpr *>(expr) ) {
     294                                                        expr = temp->arg;
     295                                                }
     296                                                last_val = ((ConstantExpr *)expr)->constant.get_ival();
    293297                                        } else {
    294298                                                output << ++last_val;
Note: See TracChangeset for help on using the changeset viewer.