@@ -688,7 +688,7 @@ int pc_compile(int argc, char *argv[])
688
688
spawnl (P_WAIT ,pgmname ,pgmname ,reportname ,dotname ,NULL );
689
689
#else
690
690
snprintf (pgmname ,sizearray (pgmname ),"%s%cstategraph" ,sc_binpath ,DIRSEP_CHAR );
691
- posix_spawnl (pgmname ,reportname ,dotname ,( char * ) NULL );
691
+ posix_spawnl (pgmname ,reportname ,dotname ,NULL );
692
692
#endif
693
693
}
694
694
} /* if */
@@ -2755,19 +2755,23 @@ static void initials(int ident,int usage,int tag,cell *size,int dim[],int numdim
2755
2755
if (!matchtoken ('=' )) {
2756
2756
cell tablesize ;
2757
2757
assert (ident != iARRAY || numdim > 0 );
2758
- if (ident == iARRAY && dim [numdim - 1 ]== 0 ) {
2759
- /* declared as "myvar[];" which is senseless (note: this *does* make
2760
- * sense in the case of a iREFARRAY, which is a function parameter)
2761
- */
2762
- error (9 ); /* array has zero length -> invalid size */
2763
- } /* if */
2764
2758
if (ident == iARRAY ) {
2759
+ int i ;
2765
2760
assert (numdim > 0 && numdim <=sDIMEN_MAX );
2761
+ for (i = 0 ; i < numdim ; i ++ ) {
2762
+ if (dim [i ]== 0 ) {
2763
+ /* any of array size is zero which is senseless (note: this *does* make
2764
+ * sense in the case of a iREFARRAY, which is a function parameter)
2765
+ */
2766
+ error (9 ); /* array has zero length -> invalid size */
2767
+ return ;
2768
+ }
2769
+ }
2766
2770
* size = calc_arraysize (dim ,numdim ,0 );
2767
2771
if (* size == (cell )CELL_MAX ) {
2768
2772
error (9 ); /* array is too big -> invalid size */
2769
2773
return ;
2770
- } /* if */
2774
+ }
2771
2775
/* first reserve space for the indirection vectors of the array, then
2772
2776
* adjust it to contain the proper values
2773
2777
* (do not use dumpzero(), as it bypasses the literal queue)
0 commit comments