summaryrefslogtreecommitdiff
path: root/graphics/asymptote/array.cc
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/array.cc')
-rw-r--r--graphics/asymptote/array.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/graphics/asymptote/array.cc b/graphics/asymptote/array.cc
index 58c4371064..311e0cf822 100644
--- a/graphics/asymptote/array.cc
+++ b/graphics/asymptote/array.cc
@@ -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)