* Helper for preparing SubscriptingRef expressions for evaluation: is expr * a nested FieldStore or SubscriptingRef that needs the old element value * passed down? * * (We could use this in FieldStore too, but in that case passing the old * value is so cheap there's no need.) * * Note: it might seem that this needs to recurse, but in most cases it does * not; the CaseTestExpr, if any, will
| 3180 | * be able to look through that. |
| 3181 | */ |
| 3182 | static bool |
| 3183 | isAssignmentIndirectionExpr(Expr *expr) |
| 3184 | { |
| 3185 | if (expr == NULL) |
| 3186 | return false; /* just paranoia */ |
| 3187 | if (IsA(expr, FieldStore)) |
| 3188 | { |
| 3189 | FieldStore *fstore = (FieldStore *) expr; |
| 3190 | |
| 3191 | if (fstore->arg && IsA(fstore->arg, CaseTestExpr)) |
| 3192 | return true; |
| 3193 | } |
| 3194 | else if (IsA(expr, SubscriptingRef)) |
| 3195 | { |
| 3196 | SubscriptingRef *sbsRef = (SubscriptingRef *) expr; |
| 3197 | |
| 3198 | if (sbsRef->refexpr && IsA(sbsRef->refexpr, CaseTestExpr)) |
| 3199 | return true; |
| 3200 | } |
| 3201 | else if (IsA(expr, CoerceToDomain)) |
| 3202 | { |
| 3203 | CoerceToDomain *cd = (CoerceToDomain *) expr; |
| 3204 | |
| 3205 | return isAssignmentIndirectionExpr(cd->arg); |
| 3206 | } |
| 3207 | else if (IsA(expr, RelabelType)) |
| 3208 | { |
| 3209 | RelabelType *r = (RelabelType *) expr; |
| 3210 | |
| 3211 | return isAssignmentIndirectionExpr(r->arg); |
| 3212 | } |
| 3213 | return false; |
| 3214 | } |
| 3215 | |
| 3216 | /* |
| 3217 | * Prepare evaluation of a CoerceToDomain expression. |
no outgoing calls
no test coverage detected