diff options
-rw-r--r-- | 032array.cc | 12 | ||||
-rw-r--r-- | 036refcount.cc | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/032array.cc b/032array.cc index 8d08fdc2..6e583e6d 100644 --- a/032array.cc +++ b/032array.cc @@ -128,7 +128,7 @@ container foo [ :(before "End Load Container Element Definition") { const type_tree* type = info.elements.back().type; - if (type->name == "array") { + if (type && type->name == "array") { if (!type->right) { raise << "container '" << name << "' doesn't specify type of array elements for '" << info.elements.back().name << "'\n" << end(); continue; @@ -140,6 +140,16 @@ container foo [ } } +:(scenario code_inside_container) +container card [ + rank:number <- next-ingredient +] +recipe foo [ + 1:card <- merge 3 + 2:number <- get 1:card rank:offset +] +# shouldn't die + //:: To access elements of an array, use 'index' :(scenario index) diff --git a/036refcount.cc b/036refcount.cc index 73ad8928..02af0ab9 100644 --- a/036refcount.cc +++ b/036refcount.cc @@ -588,6 +588,7 @@ bool is_mu_container(const reagent& r) { return is_mu_container(r.type); } bool is_mu_container(const type_tree* type) { + if (!type) return false; if (type->value == 0) return false; type_info& info = get(Type, type->value); return info.kind == CONTAINER; @@ -597,6 +598,7 @@ bool is_mu_exclusive_container(const reagent& r) { return is_mu_exclusive_container(r.type); } bool is_mu_exclusive_container(const type_tree* type) { + if (!type) return false; if (type->value == 0) return false; type_info& info = get(Type, type->value); return info.kind == EXCLUSIVE_CONTAINER; |