@@ -6370,15 +6370,18 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
6370
6370
if (!isstring) return 0 ;
6371
6371
6372
6372
// If we reach here, the PTRSUB should be converted to a (COPY of a) pointer constant.
6373
- list<PcodeOp *>::const_iterator iter,enditer;
6374
- iter = outvn->beginDescend ();
6375
- enditer = outvn->endDescend ();
6376
- bool removeCopy = true ;
6377
- while (iter != enditer) {
6378
- PcodeOp *subop = *iter; // Give each descendant of op a chance to further propagate the constant
6379
- ++iter;
6380
- if (!pushConstFurther (data,outtype,subop,subop->getSlot (outvn),vn1->getOffset ()))
6381
- removeCopy = false ; // If the descendant does NOT propagate const, do NOT remove op
6373
+ bool removeCopy = false ;
6374
+ if (!outvn->isAddrForce ()) {
6375
+ removeCopy = true ; // Assume we can remove, unless we can't propagate to all descendants
6376
+ list<PcodeOp *>::const_iterator iter,enditer;
6377
+ iter = outvn->beginDescend ();
6378
+ enditer = outvn->endDescend ();
6379
+ while (iter != enditer) {
6380
+ PcodeOp *subop = *iter; // Give each descendant of op a chance to further propagate the constant
6381
+ ++iter;
6382
+ if (!pushConstFurther (data,outtype,subop,subop->getSlot (outvn),vn1->getOffset ()))
6383
+ removeCopy = false ; // If the descendant does NOT propagate const, do NOT remove op
6384
+ }
6382
6385
}
6383
6386
if (removeCopy) {
6384
6387
data.opDestroy (op);
0 commit comments