summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/array.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/array.cc')
-rw-r--r--Build/source/utils/asymptote/array.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/array.cc b/Build/source/utils/asymptote/array.cc
index 58c43710641..c70f5e22f38 100644
--- a/Build/source/utils/asymptote/array.cc
+++ b/Build/source/utils/asymptote/array.cc
@@ -1,7 +1,7 @@
/*****
* array.cc
* Andy Hammerlindl 2008/01/26
- *
+ *
* Array type used by virtual machine.
*****/
@@ -10,6 +10,8 @@
namespace vm {
+const char *dereferenceNullArray="dereference of null array";
+
inline void checkBackSlice(Int left, Int right)
{
if (right < left)
@@ -156,10 +158,11 @@ void array::setSlice(Int left, Int right, array *a)
item copyItemToDepth(item i, size_t depth)
{
- if (depth == 0)
+ if(depth == 0)
return i;
- else
- return get<array *>(i)->copyToDepth(depth);
+ array* a=get<array*>(i);
+ if(a == 0) vm::error(dereferenceNullArray);
+ return a->copyToDepth(depth);
}
array *array::copyToDepth(size_t depth)