summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/array.c b/array.c
index 2e0e71e..bf75a1b 100644
--- a/array.c
+++ b/array.c
@@ -138,6 +138,16 @@ commontype(Array *a, Array *b, Array **aa, Array **bb, int forcefloat)
}else if(a->type == AtypeInt && b->type == AtypeFloat){
*aa = inttofloatarray(a);
*bb = fnSame(b);
+ }else if(a->type == AtypeArray && b->type != AtypeArray){
+ *aa = fnSame(a);
+ *bb = allocarray(AtypeArray, 0, 1);
+ (*bb)->arraydata[0] = b;
+ incref(b);
+ }else if(a->type != AtypeArray && b->type == AtypeArray){
+ *aa = allocarray(AtypeArray, 0, 1);
+ (*aa)->arraydata[0] = a;
+ incref(a);
+ *bb = fnSame(b);
}else
return 0;
return 1;