diff options
Diffstat (limited to 'Build/source/utils/asymptote/dec.cc')
-rw-r--r-- | Build/source/utils/asymptote/dec.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/dec.cc b/Build/source/utils/asymptote/dec.cc index 731e4b9db1c..10154609576 100644 --- a/Build/source/utils/asymptote/dec.cc +++ b/Build/source/utils/asymptote/dec.cc @@ -83,10 +83,16 @@ void arrayTy::prettyprint(ostream &out, Int indent) // NOTE: Can this be merged with trans somehow? void arrayTy::addOps(coenv &e, record *r) { - types::array *t=dynamic_cast<types::array *>(trans(e, true)); - e.e.addArrayOps(t); - if (r) - r->e.addArrayOps(t); + types::ty *t=trans(e, true); + + // Only add ops if it is an array (and not, say, an error) + if (t->kind == types::ty_array) { + types::array *at=dynamic_cast<types::array *>(t); + assert(at); + e.e.addArrayOps(at); + if (r) + r->e.addArrayOps(at); + } } types::ty *arrayTy::trans(coenv &e, bool tacit) @@ -94,6 +100,10 @@ types::ty *arrayTy::trans(coenv &e, bool tacit) types::ty *ct = cell->trans(e, tacit); assert(ct); + // Don't make an array of errors. + if (ct->kind == types::ty_error) + return ct; + types::array *t = dims->truetype(ct); assert(t); |