diff --git a/src/mapleall/maple_driver/defs/phases.def b/src/mapleall/maple_driver/defs/phases.def index b495f817c8a0d00bce77549e3685957cc21cde14..749a7e0352e781dc8b339b5e3668c9eeba75aef8 100644 --- a/src/mapleall/maple_driver/defs/phases.def +++ b/src/mapleall/maple_driver/defs/phases.def @@ -62,9 +62,9 @@ ADD_PHASE("rclowering", JAVALANG && !MeOption::noRC && MeOption::rcLowering && ! ADD_PHASE("gclowering", JAVALANG && MeOption::gcOnly) ADD_PHASE("rename2preg", MeOption::optLevel >= 2) ADD_PHASE("lpre", MeOption::optLevel >= 2) -ADD_PHASE("storepre", MeOption::optLevel >= 2) ADD_PHASE("copyprop", MeOption::optLevel >= 2 && !JAVALANG) ADD_PHASE("hdse", MeOption::optLevel >= 2 && !JAVALANG) +ADD_PHASE("storepre", MeOption::optLevel >= 2) ADD_PHASE("pregrename", MeOption::optLevel >= 2) ADD_PHASE("bblayout", MeOption::optLevel >= 2 || JAVALANG) ADD_PHASE("emit", MeOption::optLevel >= 2 || JAVALANG) diff --git a/src/mapleall/maple_ir/src/mir_type.cpp b/src/mapleall/maple_ir/src/mir_type.cpp index 60b09e5faf168de8e81ca3cbbbdf73e7681b4882..18bb58d2a0737b98492b1d6714fd61e42d38c35d 100644 --- a/src/mapleall/maple_ir/src/mir_type.cpp +++ b/src/mapleall/maple_ir/src/mir_type.cpp @@ -1979,8 +1979,10 @@ TyIdxFieldAttrPair MIRPtrType::GetPointedTyIdxFldAttrPairWithFieldID(FieldID fld } MIRType *ty = GlobalTables::GetTypeTable().GetTypeFromTyIdx(pointedTyIdx); MIRStructType *structTy = ty->EmbeddedStructType(); - CHECK_FATAL(structTy, - "MIRPtrType::GetPointedTyidxWithFieldId(): cannot have non-zero fieldID for something other than a struct"); + if (structTy == nullptr) { + // this can happen due to casting in C; just return the pointed to type + return TyIdxFieldAttrPair(pointedTyIdx, FieldAttrs()); + } return structTy->TraverseToField(fldId).second; }