- addrconst = triple(state, OP_ADDRCONST, type, 0, 0);
- MISC(addrconst, 0) = def;
- def = addrconst;
+ if ((def->op == OP_SDECL) || is_const(def)) {
+ struct triple *addrconst;
+ if ((def->op != OP_SDECL) && (def->op != OP_BLOBCONST)) {
+ internal_error(state, def, "bad array constant");
+ }
+ addrconst = triple(state, OP_ADDRCONST, type, 0, 0);
+ MISC(addrconst, 0) = def;
+ def = addrconst;
+ }
+ else {
+ def = triple(state, OP_COPY, type, def, 0);
+ }